<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Glorified Geek</title>
	<atom:link href="http://rubayeet.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rubayeet.wordpress.com</link>
	<description>ruminations of a shiftless mind</description>
	<lastBuildDate>Thu, 12 Nov 2009 02:37:31 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='rubayeet.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/b605c1d5b6a1e8d547b3a1d1aa4c3355?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Glorified Geek</title>
		<link>http://rubayeet.wordpress.com</link>
	</image>
			<item>
		<title>Django: How to make a variable available in all templates</title>
		<link>http://rubayeet.wordpress.com/2009/10/31/django-how-to-make-a-variable-available-in-all-templates/</link>
		<comments>http://rubayeet.wordpress.com/2009/10/31/django-how-to-make-a-variable-available-in-all-templates/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 06:14:26 +0000</pubDate>
		<dc:creator>rubayeet</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://rubayeet.wordpress.com/?p=375</guid>
		<description><![CDATA[Sometimes when building a web application with Django, you have a common piece of information that is available at all the templates. Foe example, you may have a dynamically built tree menu appearing in multiple templates.  It&#8217;s possible to achieve so by adding the data to the context of each template. But that goes against [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=375&subd=rubayeet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Sometimes when building a web application with Django, you have a common piece of information that is available at all the templates. Foe example, you may have a dynamically built tree menu appearing in multiple templates.  It&#8217;s possible to achieve so by adding the data to the context of each template. But that goes against Django&#8217;s policy on code reuse. The right way to do that, is to use template context processors and ReuestContext objects.</p>
<p>The sections on Django official documentation are either <a href="http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors" target="_blank">too short</a> or under <a href="http://docs.djangoproject.com/en/dev/ref/templates/api/#id1" target="_blank">misleading headings</a>. So I&#8217;m trying to write this in a paint-by-numbers sort of way.</p>
<p><strong>First, the template</strong></p>
<p>Let&#8217;s suppose you have the following silly piece of HTML in each of your templates</p>
<p><code>Hello World! My name is {{name}}</code></p>
<p><strong>Next, create a custom context processor</strong></p>
<p style="text-align:justify;">Under the directory of your Django application create a new file. Let&#8217;s name it &#8216;custom_context_processors.py&#8217;. This is your custom context processor, that will list a number of methods, each of which will have a HttpRequest object as parameter. Suppose you want to have a variable named &#8216;domain&#8217; available at all template. Let&#8217;s add a method to the processor by that name:
</p>
<p><code></p>
<pre>define name(request):
   return {'name': 'Django Guru'}</pre>
<p></code></p>
<p><strong>Install the Context Processor</strong></p>
<p>Open settings.py. Add the following line in the TEMPLATE_CONTEXT_PROCESSORS</p>
<p><code>'myapp.custom_context_processors.domain,'</code></p>
<p><strong>Add the RequestContext</strong></p>
<p>In your views.py, import the RequestContext module</p>
<p><code>from django.templates import RequestContext</code></p>
<p style="text-align:justify;">Now when you render the template using render_to_response() method, a RequestContext object has to be added as the optional context_instance argument. The RequestContext object takes a HttpRequest object as a parameter</p>
<p><code></p>
<pre>def my_view(request):
   #view code
   return redner_to_response('my_template.html', {'foo:bar'}, \
                              context_instance=RequestContext(request))</pre>
<p></code></p>
<p style="text-align:justify;">The variable {{name}} will now be available in my_template.html, without explicitly adding it in the template context. If you need to make it available in some_other_template.html, all you need to do is to pass the RequestContext object as the third parameter to render_to_reponse().</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubayeet.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubayeet.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rubayeet.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rubayeet.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rubayeet.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rubayeet.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rubayeet.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rubayeet.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rubayeet.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rubayeet.wordpress.com/375/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=375&subd=rubayeet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rubayeet.wordpress.com/2009/10/31/django-how-to-make-a-variable-available-in-all-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44060e16163fceaddae337f87357c6ca?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">rubayeet</media:title>
		</media:content>
	</item>
		<item>
		<title>Python equivalent of PHP&#8217;s ip2long()</title>
		<link>http://rubayeet.wordpress.com/2009/10/23/python-equivalent-php-ip2lon/</link>
		<comments>http://rubayeet.wordpress.com/2009/10/23/python-equivalent-php-ip2lon/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 09:09:04 +0000</pubDate>
		<dc:creator>rubayeet</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://rubayeet.wordpress.com/?p=379</guid>
		<description><![CDATA[I&#8217;ve been spoiled by PHP! It sometimes makes your job too easy with its large collection of library functions. Python, on the other hand, has a lot of powerful tools for doing low-level stuff. To get something done, which would take a single function call in PHP, you may have to meld together a number [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=379&subd=rubayeet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">I&#8217;ve been spoiled by PHP! It sometimes makes your job too easy with its large collection of library functions. Python, on the other hand, has a lot of powerful tools for doing low-level stuff. To get something done, which would take a single function call in PHP, you may have to meld together a number of those tools and build a new one.</p>
<p style="text-align:justify;">I was looking for a Python equivalent of PHP&#8217;s <a href="http://www.php.net/manual/en/function.ip2long.php" target="_blank">ip2long()</a> function. which converts an IPv4 address from dotted decimal notation(for example 208.69.34.231) to a 32 bit integer(3494191847). After spending few minutes with Google, I realized that Python has no such function in it&#8217;s core or standard library. To achieve this, I had to make use of Python&#8217;s <a href="http://docs.python.org/library/socket.html" target="_blank">socket</a> interface and <a href="http://docs.python.org/library/struct.html" target="_blank">struct</a> library. Here&#8217;s what I did:<br />
<code><br />
from socket import inet_aton<br />
from sturct import unpack</code></p>
<p><code> </code></p>
<p style="text-align:justify;"><code>def ip2long(ip_addr):<br />
...ip_packed = inet_aton(ip_addr)<br />
...ip = unpack("!L", ip_packed)[0]<br />
...return ip<br />
</code><br />
Note: Dots(.) in the above code represents indentation. WordPress is eating up the whitespace mysteriously!</p>
<p style="text-align:justify;">The first line inside the ip2long() method, the <a href="http://docs.python.org/library/socket.html#socket.inet_aton">inet_aton()</a> function, converts the dotted-quad IP address to a 32-bit packed binary format, which is string of four characters in length. To make it an integer, you have to unpack it with the <a href="http://docs.python.org/library/struct.html#struct.unpack" target="_blank">unpack()</a> method, which takes the format as the first argument(which is &#8220;!L&#8221; in this case, for big-endian unsigned integer) and the packed string as the second. It returns a tuple with  the 32-bit integer as the first element.</p>
<p style="text-align:justify;">To make a <a href="http://www.php.net/manual/en/function.long2ip.php">long2ip()</a> function you can just reverse engineer the above process with <a href="http://docs.python.org/library/struct.html#struct.pack" target="_blank">struct.pack</a> and and <a href="http://docs.python.org/library/socket.html#socket.inet_ntoa" target="_blank">socket.inet_ntoa</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubayeet.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubayeet.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rubayeet.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rubayeet.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rubayeet.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rubayeet.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rubayeet.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rubayeet.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rubayeet.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rubayeet.wordpress.com/379/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=379&subd=rubayeet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rubayeet.wordpress.com/2009/10/23/python-equivalent-php-ip2lon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44060e16163fceaddae337f87357c6ca?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">rubayeet</media:title>
		</media:content>
	</item>
		<item>
		<title>Back in Gordon Freeman&#8217;s Suit!</title>
		<link>http://rubayeet.wordpress.com/2009/09/30/back-in-gordon-freemans-suit/</link>
		<comments>http://rubayeet.wordpress.com/2009/09/30/back-in-gordon-freemans-suit/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 17:56:16 +0000</pubDate>
		<dc:creator>rubayeet</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Random Ruminations]]></category>
		<category><![CDATA[gaming]]></category>

		<guid isPermaLink="false">http://rubayeet.wordpress.com/?p=359</guid>
		<description><![CDATA[
I am playing PC game again!
It&#8217;s Half Life 2 Episode 1!
I know you&#8217;re rolling your eyes thinking &#8216;How 2004 are you? That&#8217;s an old game!&#8221;.  I know, but I haven&#8217;t been around gaming  for a long time. I think I somewhat grew bored of it as I got involved other responsibilities in my personal life.
When [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=359&subd=rubayeet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;"><img class="alignnone size-full wp-image-363" title="gordon" src="http://rubayeet.files.wordpress.com/2009/09/gordon1.jpg?w=300&#038;h=393" alt="gordon" width="300" height="393" /></p>
<p style="text-align:justify;">I am playing PC game again!</p>
<p style="text-align:justify;">It&#8217;s <a href="http://www.gamespot.com/pc/action/halflife2aftermath/index.html">Half Life 2 Episode 1</a>!</p>
<p style="text-align:justify;">I know you&#8217;re rolling your eyes thinking &#8216;How 2004 are you? That&#8217;s an old game!&#8221;.  I know, but I haven&#8217;t been around gaming  for a long time. I think I somewhat grew bored of it as I got involved other responsibilities in my personal life.</p>
<p style="text-align:justify;">When I recently got my hands on this game, I couldn&#8217;t resist the temptation to play the sequel to <a href="http://en.wikipedia.org/wiki/List_of_best-selling_video_games#Top_PC_sellers_by_genre" target="_blank"><span style="text-decoration:none;">one of the best PC games of all time</span></a>. I booted my PC, which I have been neglecting since the new Macbook Pro came in, installed the game from the DVD, fired it up and started another journey through Half-life&#8217;s universe.</p>
<p style="text-align:justify;">There are some cultural changes I have noticed so far. Instead of the legendary crowbar, the game starts with the gravity gun as the first weapon at hand. The biggest change of all, is that Gordon Freeman isn&#8217;t alone this time, he has a friend! It&#8217;s <a href="http://half-life.wikia.com/wiki/Alyx_Vance" target="_blank">Alyx Vance</a>!  The ass-kicking chick from Half-life 2. The developers at Valve have designed a sophisticated buddy system, so Alyx is going to fight alongside Gordon throughout the whole game. AI programming in games has come a long way from <a href="http://en.wikipedia.org/wiki/Daikatana" target="_blank">Daikatana</a>, where moronic activities of your AI controlled buddy(like coming in the line of fire, or firing at you!) made me want to chop that buddy into pieces!</p>
<p style="text-align:justify;"><img class="alignnone size-medium wp-image-366" title="ep1_desktop5_1600x" src="http://rubayeet.files.wordpress.com/2009/09/ep1_desktop5_1600x.jpg?w=300&#038;h=225" alt="ep1_desktop5_1600x" width="300" height="225" /></p>
<p style="text-align:justify;">I&#8217;m enjoying the game experience so far. And I&#8217;m quite glad that Alyx is with me. I&#8217;ve always felt a sense of desperation and fear, as I went through Half Life&#8217;s cinematic thrilling environment. That&#8217;s why it&#8217;s really good that I have Alyx by my side!</p>
<p style="text-align:justify;"><strong>Update </strong>Finished playing Episode 1 few nights back. It was shorter than I expected but satisfying. Just started to play <a href="http://www.gamespot.com/pc/action/halflife2episodetwo/index.html" target="_blank">Episode Two</a>!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubayeet.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubayeet.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rubayeet.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rubayeet.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rubayeet.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rubayeet.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rubayeet.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rubayeet.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rubayeet.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rubayeet.wordpress.com/359/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=359&subd=rubayeet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rubayeet.wordpress.com/2009/09/30/back-in-gordon-freemans-suit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44060e16163fceaddae337f87357c6ca?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">rubayeet</media:title>
		</media:content>

		<media:content url="http://rubayeet.files.wordpress.com/2009/09/gordon1.jpg" medium="image">
			<media:title type="html">gordon</media:title>
		</media:content>

		<media:content url="http://rubayeet.files.wordpress.com/2009/09/ep1_desktop5_1600x.jpg?w=300" medium="image">
			<media:title type="html">ep1_desktop5_1600x</media:title>
		</media:content>
	</item>
		<item>
		<title>Deploying Rails Application on Apache with Phusion Passenger</title>
		<link>http://rubayeet.wordpress.com/2009/09/03/deploying-rails-application-on-apache-with-phusion-passenger/</link>
		<comments>http://rubayeet.wordpress.com/2009/09/03/deploying-rails-application-on-apache-with-phusion-passenger/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 07:58:50 +0000</pubDate>
		<dc:creator>rubayeet</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rubayeet.wordpress.com/?p=342</guid>
		<description><![CDATA[

This morning I put on my system admin hat at work once again. The challenge was to setup a Rails development environment on our production server at the cloud and then deploy a Rails application on Apache.
This article is not really a tutorial, although it&#8217;s posted under How-to category. It&#8217;s more like a log of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=342&subd=rubayeet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img class="alignnone size-full wp-image-372" title="facebookdc" src="http://rubayeet.files.wordpress.com/2009/09/facebookdc.jpg?w=450&#038;h=285" alt="facebookdc" width="450" height="285" /></p>
<p style="text-align:justify;">
<p style="text-align:justify;">This morning I put on my system admin hat at work once again. The challenge was to setup a Rails development environment on our production server at the cloud and then deploy a Rails application on Apache.</p>
<p style="text-align:justify;">This article is not really a tutorial, although it&#8217;s posted under <a href="http://rubayeet.wordpress.com/category/how-to/">How-to</a> category. It&#8217;s more like a log of my actions in carrying out this task; the problems I faced and what I did to get around them, so that I can trace them back if I ever partake a similar task in future.</p>
<p style="text-align:justify;">Rails have <a href="http://rubyonrails.org/deploy" target="_blank">several deployment options </a>and <a href="http://www.modrails.com/" target="_blank">Phusion Passenger a.k.a. Mod Rails</a> is the principle of them. It supports both Apache and the lightweight <a href="http://www.nginx.net/">Nginx</a> Server. Check out there <a href="http://www.modrails.com/documentation.html" target="_blank">documentation page</a>.</p>
<p style="text-align:justify;"><strong>Here&#8217;s how it went</strong></p>
<p style="text-align:justify;">Logged into the remote server(CentOS 5.0) using ssh</p>
<p style="text-align:justify;">Installed Rails</p>
<p style="text-align:justify;"><em><span style="font-family:Courier New;"> gem install -v=2.2.2 rails</span><br />
</em><br />
Installed MySQL gem</p>
<p style="text-align:justify;"><em> <span style="font-family:Courier New;">gem install mysql &#8212; &#8211;with-mysql-include=/usr/include/mysql &#8211;with-mysql-lib=/usr/lib/mysql/</span><br style="font-family:Courier New;" /></em><br />
Installed Phusion Passenger<br />
<em> <span style="font-family:Courier New;"><br />
gem install passenger</span><br style="font-family:Courier New;" /></em><br />
Warning received. Required Software missing</p>
<p style="text-align:justify;"><span style="color:#ff0000;">Apache 2 development headers&#8230; not found</span><br style="color:#ff9900;" /><br />
Installed Apache 2 Development Headers</p>
<p style="text-align:justify;"><em> <span style="font-family:Courier New;">yum install httpd-devel</span></em><br style="font-family:Courier New;" /><br />
Installed Apache module for Passenger</p>
<p style="text-align:justify;"><em> <span style="font-family:Courier New;">passenger-install-apache2-module</span><br style="font-family:Courier New;" /></em><br />
Configured Apache 2 to load the mod_passenger module by adding these lines in <span style="text-decoration:underline;">/etc/httpd/conf/httpd.conf</span></p>
<p style="text-align:justify;"><span style="color:#00ff00;">LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so<br />
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6<br style="color:#0000ff;" />PassengerRuby /usr/bin/ruby</span></p>
<p style="text-align:justify;">Uploaded a sample Rails App(myrailsapp) to /home</p>
<p style="text-align:justify;">Added following lines in <span style="text-decoration:underline;">/etc/httpd/conf/httpd.conf</span> to create a new virtual host</p>
<p style="text-align:justify;"><span style="color:#00ff00;">&lt;VirtualHost *:80&gt;<br style="color:#0000ff;" /> ServerName rails.myserver.com<br style="color:#0000ff;" /> DocumentRoot /home/myrailsapp/public<br style="color:#0000ff;" /> RailsEnv    development<br style="color:#0000ff;" /> &lt;/VirtualHost&gt;</span></p>
<p style="text-align:justify;">Restart Apache</p>
<p style="text-align:justify;"><em> <span style="font-family:Courier New;">service httpd restart</span><br style="font-family:Courier New;" /></em><br />
Went to http://rails.myserver.com.</p>
<p style="text-align:justify;">Standard Error page for Phusion Passenger displayed. Instructed to consult Apache error log</p>
<p style="text-align:justify;">Checked out the Apache Error Log</p>
<p style="text-align:justify;"><em> <span style="font-family:Courier New;">cat /etc/httpd/logs/error_log</span><br style="font-family:Courier New;" /></em><br />
The last error was</p>
<p style="text-align:justify;"><span style="color:#ff0000;">Rails requires RubyGems &gt;= 1.3.1 (you have 1.2.0). Please `gem update &#8211;system` and try again.</span></p>
<p style="text-align:justify;">Updated RubyGems</p>
<p style="text-align:justify;"><em> <span style="font-family:Courier New;">gem install rubygems-update</span><br style="font-family:Courier New;" /><span style="font-family:Courier New;"> update_rubygems</span><br />
</em><br />
Restarted Apache and went to http://rails.myserver.com again. The following error was showing on the page</p>
<p style="text-align:justify;"><span style="color:#ff0000;">no such file to load &#8212; sqlite3</span><br style="color:#ff0000;" /><br />
Reason: SQLite3-Ruby Gem missing. Tried to install it</p>
<p style="text-align:justify;"><em> <span style="font-family:Courier New;">gem install sqlite3-ruby</span></em><br style="font-family:Courier New;" /><br />
Failed. The system doesn&#8217;t have SQLite3 installed</p>
<p style="text-align:justify;"><span style="color:#ff0000;">checking for sqlite3.h&#8230; no</span></p>
<p style="text-align:justify;">Installed SQLite3 by building in from source</p>
<p style="text-align:justify;"><em> <span style="font-family:Courier New;"> </span><span style="font-family:Courier New;">wget http://www.sqlite.org/sqlite-amalgamation-3.6.17.tar.gz</span><br style="font-family:Courier New;" /><span style="font-family:Courier New;"> tar xvzf sqlite-amalgamation-3.6.17.tar.gz </span><br style="font-family:Courier New;" /><span style="font-family:Courier New;"> cd sqlite-3.6.17</span><br style="font-family:Courier New;" /><span style="font-family:Courier New;"> ./configure</span><br style="font-family:Courier New;" /><span style="font-family:Courier New;"> make</span><br style="font-family:Courier New;" /><span style="font-family:Courier New;"> make install</span><br />
</em><br />
Installed SQLite3-Ruby Gem</p>
<p style="text-align:justify;"><em> <span style="font-family:Courier New;">gem install sqlite3-ruby</span></em><br style="font-family:Courier New;" /><br />
Restarted Apache and visited http://rails.myserver.com</p>
<p style="text-align:justify;">SUCCESS!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubayeet.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubayeet.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rubayeet.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rubayeet.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rubayeet.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rubayeet.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rubayeet.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rubayeet.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rubayeet.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rubayeet.wordpress.com/342/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=342&subd=rubayeet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rubayeet.wordpress.com/2009/09/03/deploying-rails-application-on-apache-with-phusion-passenger/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44060e16163fceaddae337f87357c6ca?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">rubayeet</media:title>
		</media:content>

		<media:content url="http://rubayeet.files.wordpress.com/2009/09/facebookdc.jpg" medium="image">
			<media:title type="html">facebookdc</media:title>
		</media:content>
	</item>
		<item>
		<title>Tethering Nokia N73 with Macbook Pro</title>
		<link>http://rubayeet.wordpress.com/2009/08/18/tethering-nokia-n73-with-macbook-pro/</link>
		<comments>http://rubayeet.wordpress.com/2009/08/18/tethering-nokia-n73-with-macbook-pro/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 17:52:40 +0000</pubDate>
		<dc:creator>rubayeet</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[EDGE]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[tethering]]></category>

		<guid isPermaLink="false">http://rubayeet.wordpress.com/?p=326</guid>
		<description><![CDATA[
Tethering your laptop with an EDGE enabled cellphone is an ideal solution for &#8220;Internet on the go&#8221; problem.
I have a Nokia N73 which  I wished to connect via Bluetooth with my Macbook Pro running on OS X 10.5.7. Unfortunately, it wasn&#8217;t a walk in the park as I expected everything with Mac to be. After [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=326&subd=rubayeet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img class="size-full wp-image-327 alignnone" title="Tethering" src="http://rubayeet.files.wordpress.com/2009/08/tethering.jpg?w=228&#038;h=232" alt="Tethering" width="228" height="232" /></p>
<p style="text-align:justify;">Tethering your laptop with an EDGE enabled cellphone is an ideal solution for &#8220;Internet on the go&#8221; problem.</p>
<p style="text-align:justify;">I have a Nokia N73 which  I wished to connect via Bluetooth with my Macbook Pro running on OS X 10.5.7. Unfortunately, it wasn&#8217;t a walk in the park as I expected everything with Mac to be. After spending quite some time searching on Google and with the help of some very useful resources(which I&#8217;ve listed at the end of this post). I was finally able to browse the Net on the macbook through the phone. I&#8217;ll outline the process below</p>
<p style="text-align:justify;"><strong>1. Download the Modem Scripts</strong></p>
<p style="text-align:justify;">Although OS X ships with modem scripts for Nokia phones, they don&#8217;t work for all the models. Ross Barkman to the rescue! His <a href="http://www.taniwha.org.uk/" target="_blank">website</a> contains customized modem scripts for a large array of cellphone brands and models. N73 is 3G enabled so you&#8217;ll need Nokia 3G scripts. <a href="http://www.taniwha.org.uk/files/Nokia3G-2006-08.zip" target="_blank">Download</a> the zip file and extract it, copy the scripts(Nokia 3G CID 1, 2 and 3) and paste them inside [RootDrive]/Library/Modem Scripts folder.</p>
<p style="text-align:justify;"><strong>2. Pair the phone with the Macbook</strong></p>
<p style="text-align:justify;">This step is pretty easy to follow. Click on the Bluetooth icon on the Menu bar(go to System Preferences &gt; Bluetooth if (it&#8217;s not there) and select &#8220;Set up Bluetooth Device&#8221;. Follow the steps to pair the phone, make sure you&#8217;ve chosen &#8220;Access the Internet&#8221; option at the final step.</p>
<p style="text-align:justify;"><strong>3. Connect to Internet</strong></p>
<ul style="text-align:justify;">
<li>Go to System Preferences &gt; Network and select Bluetooth from the left pane.</li>
<li>Click on &#8220;Advanced&#8221; button. Under the &#8220;Modem&#8221; tab, select &#8220;Other&#8221; for &#8220;Vendor&#8221; option.</li>
<li>Select &#8220;Nokia 3G CID 1&#8243; for &#8220;Vendor&#8221; option.</li>
<li>Select &#8220;Ignore dial tone when dialing&#8221; from &#8220;Dial Mode&#8221; options</li>
<li>Click OK and now back to Network Menu. Enter your phone&#8217;s APN in the &#8220;Telephone Number&#8221; box. You can know your APN from your phone&#8217;s Menu &gt; Tools &gt; Settings &gt; Connection menu.</li>
<li>Click &#8220;Apply&#8221; and then click &#8220;Connect&#8221;.</li>
</ul>
<p style="text-align:justify;">You should be connected to Net by now.</p>
<p style="text-align:justify;"><strong>Resources</strong></p>
<ol style="text-align:justify;">
<li><a href="http://www.taniwha.org.uk" target="_blank">Ross Barkman&#8217;s site</a>. It has modem scripts for several phone brands.</li>
<li style="text-align:justify;">A <a href="http://asimag.wordpress.com/2008/10/07/using-nokia-phone-as-a-modem-to-browser-internet-with-mac-os-x-leopard-tethering/" target="_blank">similar post</a> on tethering.</li>
</ol>
<p><strong>Update </strong><a href="http://the.taoofmac.com/space/HOWTO/Setup%20GPRS/UMTS%20Access%20on%20a%20Mac" target="_blank">Tao of Mac</a> has a very detailed post on this topic.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubayeet.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubayeet.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rubayeet.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rubayeet.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rubayeet.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rubayeet.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rubayeet.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rubayeet.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rubayeet.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rubayeet.wordpress.com/326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=326&subd=rubayeet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rubayeet.wordpress.com/2009/08/18/tethering-nokia-n73-with-macbook-pro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44060e16163fceaddae337f87357c6ca?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">rubayeet</media:title>
		</media:content>

		<media:content url="http://rubayeet.files.wordpress.com/2009/08/tethering.jpg" medium="image">
			<media:title type="html">Tethering</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Chrome OS &#8211; Lets try to be positive</title>
		<link>http://rubayeet.wordpress.com/2009/07/09/google-chrome-os-lets-try-to-be-positive/</link>
		<comments>http://rubayeet.wordpress.com/2009/07/09/google-chrome-os-lets-try-to-be-positive/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 17:29:19 +0000</pubDate>
		<dc:creator>rubayeet</dc:creator>
				<category><![CDATA[Opinions]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Random Ruminations]]></category>

		<guid isPermaLink="false">http://rubayeet.wordpress.com/?p=310</guid>
		<description><![CDATA[
Google&#8217;s announcement of stepping into the OS market with Google Chrome has generated quite a stir in the Net. While many have welcomed Google&#8217;s new venture, others have been busy with making absurd predictions. Some are talking about what current operating system it&#8217;s going to kill? Some saying they don&#8217;t need a new OS because [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=310&subd=rubayeet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;"><img class="alignnone size-full wp-image-311" title="1489_540" src="http://rubayeet.files.wordpress.com/2009/07/1489_540.jpg?w=450&#038;h=337" alt="1489_540" width="450" height="337" /></p>
<p style="text-align:justify;">Google&#8217;s announcement of stepping into the OS market with Google Chrome has generated <a href="http://twitter.com/#search?q=%22Chrome%20OS%22" target="_blank">quite a stir in the Net</a>. While many have welcomed Google&#8217;s new venture, others have been busy with making absurd predictions. Some are talking about <a href="http://mashable.com/2009/07/07/google-chrome-operating-system/" target="_blank">what current operating system it&#8217;s going to kill</a>? Some saying <a href="http://www.zdnet.com.au/insight/software/soa/No-thanks-Google-we-ve-got-Ubuntu/0,139023769,339297306,00.htm" target="_blank">they don&#8217;t need a new OS because they already have one they like</a>. This fellow got more creative and <a href="http://www.woot.com/Blog/ViewEntry.aspx?Id=8677" target="_blank">ranted about &#8216;features&#8217; of the OS before it&#8217;s even released!</a> It&#8217;s like blaming an unborn baby for being bad in sports?</p>
<p style="text-align:justify;">Personally, I don&#8217;t understand the motive behind this kind of negative thinking. Why not think about what new things Chomre might offer, rather than which popular OS it&#8217;s going to kill? Let Bill worry about possible market threat of Windows, we should worry about how to use Chrome. You already have the perfect desktop? May be that&#8217;s what you think and may be you are right. But should that stop others from trying to innovate, seek answers to problems you never realized you had? Google&#8217;s new browser introduced radical concepts in terms  of usability, may be the OS will do the same.</p>
<p style="text-align:justify;">As developers we should be more open minded towards innovations, and throw away this die hard slash fanboy culture.  Technology isn&#8217;t religion, you won&#8217;t be denied entry to heaven for switching to a newOS/programming language. If nothing else, <strong>competition is good</strong>. It brings the best out of people. Let&#8217;s hope it&#8217;ll force Microsoft to make a more secure Windows, or inspire Linux people to create much user friendly desktop systems.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubayeet.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubayeet.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rubayeet.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rubayeet.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rubayeet.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rubayeet.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rubayeet.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rubayeet.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rubayeet.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rubayeet.wordpress.com/310/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=310&subd=rubayeet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rubayeet.wordpress.com/2009/07/09/google-chrome-os-lets-try-to-be-positive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44060e16163fceaddae337f87357c6ca?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">rubayeet</media:title>
		</media:content>

		<media:content url="http://rubayeet.files.wordpress.com/2009/07/1489_540.jpg" medium="image">
			<media:title type="html">1489_540</media:title>
		</media:content>
	</item>
		<item>
		<title>WinDirStat gives the real picture of the hard drive, literally.</title>
		<link>http://rubayeet.wordpress.com/2009/07/07/windirstat-gives-the-real-picture-of-the-hard-drive-literally/</link>
		<comments>http://rubayeet.wordpress.com/2009/07/07/windirstat-gives-the-real-picture-of-the-hard-drive-literally/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 14:33:13 +0000</pubDate>
		<dc:creator>rubayeet</dc:creator>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://rubayeet.wordpress.com/?p=299</guid>
		<description><![CDATA[If you are trying to find out what&#8217;s eating up your precious hard disk space in Windows XP/Vista, WinDirStat is your weapon of choice. A much helpful tool than the brain dead Explorer, WinDirStat analyzes the usage statistics of your hard drive/partition/directory and outputs(along with other data) a treemap, which is a visual representation of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=299&subd=rubayeet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">If you are trying to find out what&#8217;s eating up your precious hard disk space in Windows XP/Vista, <a href="http://windirstat.info/" target="_blank">WinDirStat </a>is your weapon of choice. A much helpful tool than the brain dead Explorer, WinDirStat analyzes the usage statistics of your hard drive/partition/directory and outputs(along with other data) a treemap, which is a visual representation of how blocks of data are organized on the disk.</p>
<p><img class="alignnone size-full wp-image-301" title="windirstat" src="http://rubayeet.files.wordpress.com/2009/07/windirstat.jpg?w=450&#038;h=337" alt="windirstat" width="450" height="337" /></p>
<p style="text-align:justify;">Clicking on a block shows you the file/directory physically taking up the space in the directory list(shown in the picture). Comes quite in handy. <a href="http://twitter.com/rubayeet/status/2514095234" target="_blank">I just cleaned 1 Gigabytes worth of data cached by Safari 4.</a> If it wasn&#8217;t for WinDirStat, I would&#8217;ve never known that Safari thinks your hard drive space is infinte! Who knows, may be Steve&#8217;s is really is?</p>
<p style="text-align:justify;"><a href="http://windirstat.info/wds_current_setup.exe" target="_blank">Download WinDirStat from SourceForge.</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubayeet.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubayeet.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rubayeet.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rubayeet.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rubayeet.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rubayeet.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rubayeet.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rubayeet.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rubayeet.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rubayeet.wordpress.com/299/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=299&subd=rubayeet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rubayeet.wordpress.com/2009/07/07/windirstat-gives-the-real-picture-of-the-hard-drive-literally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44060e16163fceaddae337f87357c6ca?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">rubayeet</media:title>
		</media:content>

		<media:content url="http://rubayeet.files.wordpress.com/2009/07/windirstat.jpg" medium="image">
			<media:title type="html">windirstat</media:title>
		</media:content>
	</item>
		<item>
		<title>Deploying Django application on mod_python and Mini Mac</title>
		<link>http://rubayeet.wordpress.com/2009/07/02/deploying-django-application-on-mod_python-and-mini-mac/</link>
		<comments>http://rubayeet.wordpress.com/2009/07/02/deploying-django-application-on-mod_python-and-mini-mac/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 08:16:12 +0000</pubDate>
		<dc:creator>rubayeet</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Sys Admin]]></category>

		<guid isPermaLink="false">http://rubayeet.wordpress.com/?p=262</guid>
		<description><![CDATA[Server  : Apache 2.2
OS      : Mac OS X 10.5.4 
Python  : Version 2.5.1
Django  : Version 1.0.2 final
Machine : Mac Mini

Mod_python is a loadable Apache module which embeds the Python interpreter, so Python code can be run in-process by Apache. To deploy and run your Django application in an Apache web server you have to

Download and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=262&subd=rubayeet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;text-align:justify;">Server  : Apache 2.2</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;text-align:justify;">OS      : Mac OS X 10.5.4 </div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;text-align:justify;">Python  : Version 2.5.1</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;text-align:justify;">Django  : Version 1.0.2 final</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;text-align:justify;">Machine : Mac Mini</div>
<p style="text-align:justify;"><span style="text-decoration:underline;"><img class="alignnone size-medium wp-image-276" title="mac finder" src="http://rubayeet.files.wordpress.com/2009/07/finder.png?w=283&#038;h=300" alt="mac finder" width="283" height="300" /></span></p>
<p style="text-align:justify;"><a href="http://www.onlamp.com/pub/a/python/2003/10/02/mod_python.html">Mod_python</a> is a loadable Apache module which embeds the Python interpreter, so Python code can be run in-process by Apache. To deploy and run your Django application in an Apache web server you have to</p>
<ol style="text-align:justify;">
<li>Download and install mod_python</li>
<li>Load it in Apache</li>
<li>Configure Apache to run the Django app.</li>
</ol>
<p style="text-align:justify;">In this post I&#8217;m going to share my experience on how to do all that on a Mac Mini that runs on OS X 10.5.</p>
<p style="text-align:justify;"><strong>The Software &amp; Hardware</strong></p>
<p style="text-align:justify;">Here was my system configuration</p>
<ul style="text-align:justify;">
<li>Server  : Apache 2.2</li>
<li>OS      : Mac OS X 10.5.4 </li>
<li>Python  : Version 2.5.1</li>
<li>Django  : Version 1.0.2 final</li>
<li>Machine : Mac Mini running on 2.0 GHz Intel Core 2 Duo processor with 2GB RAM</li>
</ul>
<p style="text-align:justify;"><strong>1. Get the mod_python source</strong></p>
<p style="text-align:justify;">Check out the mod_python source code from the remote SVN repository*</p>
<pre><code>$ svn co https://svn.apache.org/repos/asf/quetzalcoatl/mod_python/trunk/ mod_python_src/</code></pre>
<p style="text-align:justify;">*The reason I&#8217;m downloading the source from an <a title="SVN Trunk of mod_python" href="https://svn.apache.org/repos/asf/quetzalcoatl/mod_python/trunk/" target="_blank">SVN trunk</a> and not from the <a title="mod_python download page" href="http://www.apache.org/dist/httpd/modpython/" target="_blank">Apache website</a>, is because the source available at the later one isn&#8217;t properly patched for Mac Mini&#8217;s architecture. In my earlier attempts, when I downloaded and built mod_python from stable releases, Apache was failing to start whenever the mod_python module was being loaded using the LoadModule Directive.</p>
<p style="text-align:justify;"><strong>2. Build the source</strong></p>
<p style="text-align:justify;">$ <code>cd mod_python_src</code></p>
<p style="text-align:justify;">$<code> ./configure --with-apxs=/usr/sbin/apxs</code></p>
<p style="text-align:justify;"><code>$ make</code></p>
<p style="text-align:justify;"><code>$ sudo make install</code></p>
<p style="text-align:justify;"><strong>3. Configure Apache to load mod_python when it starts</strong></p>
<p style="text-align:justify;">Open the Apache configuration file</p>
<p style="text-align:justify;"><code>$ sudo vi /etc/apache2/httpd.conf</code></p>
<p style="text-align:justify;">Add the following line to the file </p>
<p style="text-align:justify;"><code>LoadModule python_module libexec/apache2/mod_python.so</code></p>
<p style="text-align:justify;">Now restart Apache</p>
<p style="text-align:justify;"><code>$ sudo /usr/sbin/apachectl restart</code></p>
<p style="text-align:left;"><strong>4. Configure Apache for Django </strong></p>
<p style="text-align:left;">Let&#8217;s suppose you have a Django app callled &#8220;mysite&#8221;. Copy you the directory to the Apache DocumentRoot</p>
<p style="text-align:left;"><code>$ cp -r /path/to/mysite /Library/WebServer/Document/</code></p>
<p style="text-align:left;">Add the following lines to the httpd.conf file</p>
<p style="text-align:left;"><code>&lt;Location "/mysite"&gt;</code></p>
<p style="text-align:left;"><code>    SetHandler python-program</code></p>
<p style="text-align:left;"><span style="white-space:pre;"> </span><code>PythonPath "['/Library/WebServer/Documents'] + sys.path"</code></p>
<p style="text-align:left;">    <span style="white-space:pre;"> </span><code>PythonHandler django.core.handlers.modpython</code></p>
<p style="text-align:left;">    <span style="white-space:pre;"> </span><code>SetEnv DJANGO_SETTINGS_MODULE mysite.settings</code></p>
<p style="text-align:left;"><span style="white-space:pre;"> </span><code>PythonAutoReload On</code></p>
<p style="text-align:left;"><span style="white-space:pre;"> </span><code>PythonDebug On</code></p>
<p style="text-align:left;"><code>&lt;/Location&gt;</code></p>
<p style="text-align:left;">This&#8217;ll make Apache to route any requests under URL &#8220;/mysite&#8221; to the mod_python handler. It passes the value of DJANGO_SETTINGS_MODULE so mod_python knows which settings to use.</p>
<p style="text-align:left;">Now restart Apache and go to the site http://localhost/mysite</p>
<p style="text-align:left;">If it works then congratulations! You&#8217;ve just deployed your app on Apache!</p>
<p style="text-align:justify;"><strong>Troubleshooting tip(s)</strong></p>
<p style="text-align:justify;">If Apache fails to launch after you&#8217;ve installed and loaded mod_python, run it in debugging mode</p>
<p style="text-align:justify;"><code>$ sudo /usr/sbin/httpd -X</code></p>
<p style="text-align:justify;">Look for any error message printed in the terminal, copy it and google it. You may find a solution online.</p>
<p style="text-align:justify;"><strong>You should also check out</strong></p>
<ul style="text-align:justify;">
<li>The <a title="mod_python on Django" href="http://docs.djangoproject.com/en/dev/howto/deployment/modpython/" target="_blank">mod_python tutorial</a> on Django website.</li>
<li>The <a href="http://www.modpython.org/live/current/doc-html/" target="_blank">official documentation</a> of mod_python</li>
<li>A <a href="http://markmail.org/message/dca6xxdctzjkdo5g#query:mysite.settings%20mod_python+page:1+mid:dca6xxdctzjkdo5g+state:results" target="_blank">helpful conversation</a> on MarkMail</li>
</ul>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubayeet.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubayeet.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rubayeet.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rubayeet.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rubayeet.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rubayeet.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rubayeet.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rubayeet.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rubayeet.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rubayeet.wordpress.com/262/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=262&subd=rubayeet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rubayeet.wordpress.com/2009/07/02/deploying-django-application-on-mod_python-and-mini-mac/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44060e16163fceaddae337f87357c6ca?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">rubayeet</media:title>
		</media:content>

		<media:content url="http://rubayeet.files.wordpress.com/2009/07/finder.png?w=283" medium="image">
			<media:title type="html">mac finder</media:title>
		</media:content>
	</item>
		<item>
		<title>Here lies Michael Jackson(1958-2009), King of Pop</title>
		<link>http://rubayeet.wordpress.com/2009/06/26/here-lies-michael-jackson1958-2009-king-of-pop/</link>
		<comments>http://rubayeet.wordpress.com/2009/06/26/here-lies-michael-jackson1958-2009-king-of-pop/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 15:06:12 +0000</pubDate>
		<dc:creator>rubayeet</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://rubayeet.wordpress.com/?p=252</guid>
		<description><![CDATA[
I was surprised to see Michael Jakcson&#8217;s name appear in the Twitter trending topics this morning. I hardly suspected death to be the reason for this sudden attention to the legendary artist.
As someone who was born and brought up in the 80&#8217;s, Michael Jackson holds a special place in my heart. There was no MTV [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=252&subd=rubayeet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img class="size-medium wp-image-255 alignnone" title="michael_jackson" src="http://rubayeet.files.wordpress.com/2009/06/michael_jackson1.jpg?w=300&#038;h=265" alt="michael_jackson" width="300" height="265" /></p>
<p style="text-align:justify;">I was surprised to see Michael Jakcson&#8217;s name appear in the <a href="https://twitter.com/#search?q=%23MichaelJackson" target="_blank">Twitter trending topics</a> this morning. I hardly suspected death to be the reason for this sudden attention to the legendary artist.</p>
<p style="text-align:justify;">As someone who was born and brought up in the 80&#8217;s, Michael Jackson holds a special place in my heart. There was no MTV while I was a child, and no Internet to download mp3&#8217;s. Yet Michael Jackson was a household name in this corner of the planet. You couldn&#8217;t find a kid who never heard of &#8220;break dancing&#8221; or &#8220;moon walking&#8221;.</p>
<p style="text-align:justify;"><strong>Thriller</strong> got us thrilled, <strong>Beat it</strong> had us excited, <strong>Black or White</strong> mesmerized us with its impressive CGI,  <strong>They don&#8217;t really care about us</strong> made us stomp our feet or bang our fists on the table !</p>
<p style="text-align:justify;">His personal life reeked of controversies. But that doesn&#8217;t make him any less of an artist in my eyes. I don&#8217;t know Michael Jackson the person, I only know Michael Jackson the singer.</p>
<p style="text-align:justify;">Mark my words kiddo. He doesn&#8217;t belong to that group of suger-coated &#8216;pop stars&#8217; your Ipod generation idolizes. He&#8217;s above them. The king has surpassed. And the throne remains unclaimed.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubayeet.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubayeet.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rubayeet.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rubayeet.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rubayeet.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rubayeet.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rubayeet.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rubayeet.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rubayeet.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rubayeet.wordpress.com/252/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=252&subd=rubayeet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rubayeet.wordpress.com/2009/06/26/here-lies-michael-jackson1958-2009-king-of-pop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44060e16163fceaddae337f87357c6ca?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">rubayeet</media:title>
		</media:content>

		<media:content url="http://rubayeet.files.wordpress.com/2009/06/michael_jackson1.jpg?w=300" medium="image">
			<media:title type="html">michael_jackson</media:title>
		</media:content>
	</item>
		<item>
		<title>A farewell note</title>
		<link>http://rubayeet.wordpress.com/2009/03/19/a-farewell-note/</link>
		<comments>http://rubayeet.wordpress.com/2009/03/19/a-farewell-note/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 16:10:30 +0000</pubDate>
		<dc:creator>rubayeet</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Random Ruminations]]></category>

		<guid isPermaLink="false">http://rubayeet.wordpress.com/?p=244</guid>
		<description><![CDATA[This week I said good bye to a couple of things.
The first was my old job at Evoknow Inc. It was my first job. I joined as a trainee developer right after my graduation. I was eventually promoted to a full-time developer, and then to team leader within a year.  I had a really great [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=244&subd=rubayeet&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">This week I said good bye to a couple of things.</p>
<p style="text-align:justify;">The first was my old job at Evoknow Inc. It was my first job. I joined as a trainee developer right after my graduation. I was eventually promoted to a full-time developer, and then to team leader within a year.  I had a really great time there. My teammates were the friendliest and whackiest people on earth. I learned a lot from them, and I tried to contribute as much as possible.</p>
<p style="text-align:justify;">My new job is just a stone&#8217;s throw from the old one.  While the actual distance is small, in terms of technical demands it is a giant leap. From a seasoned PHP developer I have become a Python newbie. From a Linux/Windows user, I have turned into a Mac user+admirer. I hope to learn some really great stuff from here.</p>
<p style="text-align:justify;"><img class="size-full wp-image-245 alignnone" title="15032009144" src="http://rubayeet.files.wordpress.com/2009/03/15032009144.jpg?w=315&#038;h=236" alt="15032009144" width="315" height="236" /></p>
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">The second goodbye was to our trusty old Toyota Starlet 1996. We traded it for a brand new Toyota Corolla G 2004.  We had so many memories in it. It had been through some serious accidents. But it gave us a happy ride. I hope its new owner would be nice to it.</p>
<p style="text-align:justify;"><img class="size-medium wp-image-246 alignnone" title="04012009066" src="http://rubayeet.files.wordpress.com/2009/03/04012009066.jpg?w=225&#038;h=300" alt="04012009066" width="225" height="300" /></p>
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">
<p style="text-align:justify;">I am enjoying the smooth ride on the new car though!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubayeet.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubayeet.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rubayeet.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rubayeet.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rubayeet.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rubayeet.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rubayeet.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rubayeet.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rubayeet.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rubayeet.wordpress.com/244/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubayeet.wordpress.com&blog=3034893&post=244&subd=rubayeet&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://rubayeet.wordpress.com/2009/03/19/a-farewell-note/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44060e16163fceaddae337f87357c6ca?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">rubayeet</media:title>
		</media:content>

		<media:content url="http://rubayeet.files.wordpress.com/2009/03/15032009144.jpg" medium="image">
			<media:title type="html">15032009144</media:title>
		</media:content>

		<media:content url="http://rubayeet.files.wordpress.com/2009/03/04012009066.jpg?w=225" medium="image">
			<media:title type="html">04012009066</media:title>
		</media:content>
	</item>
	</channel>
</rss>