<?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"
	>

<channel>
	<title>CirclingMinds</title>
	<atom:link href="http://www.circlingminds.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.circlingminds.com</link>
	<description>Blog on Ruby, Merb, Rails and more</description>
	<pubDate>Sun, 05 Oct 2008 23:53:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>Getting will_paginate to work with lightbox gone wild</title>
		<link>http://www.circlingminds.com/ruby-on-rails/getting-will_paginate-to-work-with-lightbox-gone-wild/</link>
		<comments>http://www.circlingminds.com/ruby-on-rails/getting-will_paginate-to-work-with-lightbox-gone-wild/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 23:53:08 +0000</pubDate>
		<dc:creator>shovan</dc:creator>
		
		<category><![CDATA[ruby-on-rails]]></category>

		<category><![CDATA[lightbox gone wild]]></category>

		<category><![CDATA[will_paginate]]></category>

		<guid isPermaLink="false">http://www.circlingminds.com/?p=32</guid>
		<description><![CDATA[In order to get will_paginate to work with lightbox gone wild, I had to make the following modifications:
Step 1
Modify lightbox.js
Add  next, prev, start functions similiar to the example shown to the lightbox.js file

1
2
3
4
5
next: function&#40;e&#41;&#123;
link = Event.element&#40;e&#41;;
Element.remove&#40;$&#40;'lbContent'&#41;&#41;;
var myAjax = new Ajax.Request&#40; link.href, &#123;method: 'post', parameters: &#34;&#34;, onComplete: this.processInfo.bindAsEventListener&#40;this&#41;&#125; &#41;;
&#125;,

Step 2
Create a new method inside application_helper.rb.

1
2
3
4
5
6
7
8
9
10
 [...]]]></description>
			<content:encoded><![CDATA[<p>In order to get <a href="http://github.com/mislav/will_paginate/wikis">will_paginate</a> to work with <a href="http://particletree.com/features/lightbox-gone-wild/">lightbox gone wild</a>, I had to make the following modifications:</p>
<p><b>Step 1</b><br />
Modify lightbox.js<br />
Add  next, prev, start functions similiar to the example shown to the lightbox.js file</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript javascript" style="font-family:monospace;">next<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
link <span style="color: #339933;">=</span> Event.<span style="color: #660066;">element</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>;
Element.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lbContent'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #003366; font-weight: bold;">var</span> myAjax <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ajax.<span style="color: #660066;">Request</span><span style="color: #009900;">&#40;</span> link.<span style="color: #660066;">href</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>method<span style="color: #339933;">:</span> <span style="color: #3366CC;">'post'</span><span style="color: #339933;">,</span> parameters<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">,</span> onComplete<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">processInfo</span>.<span style="color: #660066;">bindAsEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></td></tr></table></div>

<p><b>Step 2</b><br />
Create a new method inside application_helper.rb.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="ruby ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> will_paginate_modified object, params
    <span style="color:#9966CC; font-weight:bold;">begin</span>
      doc = Hpricot<span style="color:#006600; font-weight:bold;">&#40;</span>will_paginate object, <span style="color:#ff3333; font-weight:bold;">:params</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>:id <span style="color:#006600; font-weight:bold;">=&gt;</span> params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:id</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  		<span style="color:#006600; font-weight:bold;">&#40;</span>doc<span style="color:#006600; font-weight:bold;">/</span><span style="color:#996600;">&quot;a&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">set</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;class&quot;</span>, <span style="color:#996600;">&quot;lbAction&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  		<span style="color:#006600; font-weight:bold;">&#40;</span>doc<span style="color:#006600; font-weight:bold;">/</span><span style="color:#996600;">&quot;a&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">set</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;rel&quot;</span>, <span style="color:#996600;">&quot;next&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  		doc.<span style="color:#9900CC;">html</span>
    <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#CC00FF; font-weight:bold;">Exception</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> e
      will_paginate object, <span style="color:#ff3333; font-weight:bold;">:params</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>:id <span style="color:#006600; font-weight:bold;">=&gt;</span> params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:id</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p><b>Step 3</b><br />
Call will_paginate_modified from your lightbox gone wild pop up view file.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="ruby ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span>= will_paginate_modified <span style="color:#0066ff; font-weight:bold;">@my_collection</span>, params <span style="color:#006600; font-weight:bold;">%&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.circlingminds.com/ruby-on-rails/getting-will_paginate-to-work-with-lightbox-gone-wild/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to debug a Merb Application</title>
		<link>http://www.circlingminds.com/merb/how-to-debug-merb-application/</link>
		<comments>http://www.circlingminds.com/merb/how-to-debug-merb-application/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 00:45:21 +0000</pubDate>
		<dc:creator>shovan</dc:creator>
		
		<category><![CDATA[Merb]]></category>

		<guid isPermaLink="false">http://www.circlingminds.com/uncategorized/how-to-debug-merb-application/</guid>
		<description><![CDATA[Merb provides the &#8220;debugger&#8221; method which makes debugging easy. Insert &#8220;debugger&#8221; in the code that you want to debug. For example:

1
2
3
4
5
6
def update
   debugger # add this line
   cool_songs = Song.find_the_cool_ones
   cool_songs.reset_new_additions
   ...
end

Next start the app in debug mode:

merb -D

Now you can step through the debugger terminal and [...]]]></description>
			<content:encoded><![CDATA[<p>Merb provides the &#8220;debugger&#8221; method which makes debugging easy. Insert &#8220;debugger&#8221; in the code that you want to debug. For example:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="ruby ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> update
   debugger <span style="color:#008000; font-style:italic;"># add this line</span>
   cool_songs = Song.<span style="color:#9900CC;">find_the_cool_ones</span>
   cool_songs.<span style="color:#9900CC;">reset_new_additions</span>
   ...
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Next start the app in debug mode:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">merb <span style="color:#006600; font-weight:bold;">-</span>D</pre></div></div>

<p>Now you can step through the debugger terminal and use the various available commands to debug your code. Type &#8216;help&#8217; at the terminal to get a list of available commands.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&#40;</span>rdb:<span style="color:#006666;">3</span><span style="color:#006600; font-weight:bold;">&#41;</span> help
help
ruby<span style="color:#006600; font-weight:bold;">-</span>debug help v0.10.1
Type <span style="color:#996600;">'help '</span> <span style="color:#9966CC; font-weight:bold;">for</span> help on a specific command
&nbsp;
Available commands:
backtrace  delete   enable  help    <span style="color:#9966CC; font-weight:bold;">next</span>  quit     show    trace
<span style="color:#9966CC; font-weight:bold;">break</span>      disable  <span style="color:#CC0066; font-weight:bold;">eval</span>    info    <span style="color:#CC0066; font-weight:bold;">p</span>     reload   source  undisplay
<span style="color:#CC0066; font-weight:bold;">catch</span>      display  <span style="color:#CC0066; font-weight:bold;">exit</span>    irb     pp    restart  step    up
condition  down     finish  list    ps    save     thread  var
continue   edit     frame   method  putl  set      tmate   where</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.circlingminds.com/merb/how-to-debug-merb-application/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to delete rails log files</title>
		<link>http://www.circlingminds.com/ruby-on-rails/how-to-delete-rails-log-files/</link>
		<comments>http://www.circlingminds.com/ruby-on-rails/how-to-delete-rails-log-files/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 03:55:06 +0000</pubDate>
		<dc:creator>shovan</dc:creator>
		
		<category><![CDATA[ruby-on-rails]]></category>

		<guid isPermaLink="false">http://www.rockclimbingutah.com/circlingminds/?p=5</guid>
		<description><![CDATA[The following command will recursively delete any development.log file within your home directory:

find ~/ -name development.log  -exec /bin/rm -f &#123;&#125; \;

]]></description>
			<content:encoded><![CDATA[<p>The following command will recursively delete any development.log file within your home directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> ~<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-name</span> development.log  <span style="color: #660033;">-exec</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> \;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.circlingminds.com/ruby-on-rails/how-to-delete-rails-log-files/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using nginx + mongrel + rails on Ubuntu</title>
		<link>http://www.circlingminds.com/advanced-rails/using-nginx-mongrel-rails-on-ubuntu/</link>
		<comments>http://www.circlingminds.com/advanced-rails/using-nginx-mongrel-rails-on-ubuntu/#comments</comments>
		<pubDate>Sat, 06 Oct 2007 04:40:49 +0000</pubDate>
		<dc:creator>shovan</dc:creator>
		
		<category><![CDATA[advanced-rails]]></category>

		<guid isPermaLink="false">http://www.rockclimbingutah.com/circlingminds/?p=3</guid>
		<description><![CDATA[STEP 1
Install Nginx. Get the source code from here. Before you compile make sure you have SSL libraries if you plan on using the SSL mode. To get the ssl libraries run:

sudo aptitude install openssl libssl-dev

To compile:

./configure --with-http_ssl_module
make
sudo make install

To start nginx run

sudo /usr/local/nginx/sbin/nginx

STEP 2
Edit

/usr/local/nginx/conf/nginx.conf&#60;/code&#62;

file to setup configuration for your rails app and mongrel cluster. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>STEP 1</strong><br />
Install Nginx. Get the source code from <a href="http://nginx.net/">here</a>. Before you compile make sure you have SSL libraries if you plan on using the SSL mode. To get the ssl libraries run:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> openssl libssl-dev</pre></div></div>

<p>To compile:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure --with-http_ssl_module
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>To start nginx run</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>nginx</pre></div></div>

<p><strong>STEP 2</strong><br />
Edit</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>nginx.conf<span style="color: #000000; font-weight: bold;">&lt;/</span>code<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>file to setup configuration for your rails app and mongrel cluster. Here is a sample of nginx.conf file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">worker_processes  <span style="color: #000000;">1</span>; 
&nbsp;
error_log  logs<span style="color: #000000; font-weight: bold;">/</span>error.log;
error_log  logs<span style="color: #000000; font-weight: bold;">/</span>error.log  notice; 
&nbsp;
pid        logs<span style="color: #000000; font-weight: bold;">/</span>nginx.pid; 
&nbsp;
events <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    worker_connections  <span style="color: #000000;">1024</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span> 
&nbsp;
http
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
        include       conf<span style="color: #000000; font-weight: bold;">/</span>mime.types;
        default_type  application<span style="color: #000000; font-weight: bold;">/</span>octet-stream;
        server_names_hash_bucket_size <span style="color: #000000;">128</span>; 
&nbsp;
        sendfile        on;
        tcp_nopush     on; 
&nbsp;
        keepalive_timeout  <span style="color: #000000;">65</span>;
        tcp_nodelay        on; 
&nbsp;
        upstream mongrel_test <span style="color: #7a0874; font-weight: bold;">&#123;</span>
            server 127.0.0.1:<span style="color: #000000;">8000</span>;
            server 127.0.0.1:<span style="color: #000000;">8001</span>;
            server 127.0.0.1:<span style="color: #000000;">8002</span>;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span> 
&nbsp;
        <span style="color: #c20cb9; font-weight: bold;">gzip</span> on;
        gzip_min_length  <span style="color: #000000;">1100</span>;
        gzip_buffers     <span style="color: #000000;">4</span> 8k;
        gzip_types       text<span style="color: #000000; font-weight: bold;">/</span>plain; 
&nbsp;
        <span style="color: #666666; font-style: italic;"># ************************ server conf begins **********************</span>
        server
        <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                listen       <span style="color: #000000;">80</span>;
             server_name  servername.com;
             root    <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>shovan<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>oas<span style="color: #000000; font-weight: bold;">/</span>public; 
&nbsp;
             access_log  off;
             rewrite_log on; 
&nbsp;
            <span style="color: #666666; font-style: italic;"># this rewrites all the requests to the maintenance.html</span>
            <span style="color: #666666; font-style: italic;"># page if it exists in the doc root. This is for capistrano's</span>
            <span style="color: #666666; font-style: italic;"># disable web task</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>-f <span style="color: #007800;">$document_root</span><span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>maintenance.html<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
              rewrite  ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>$  <span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>maintenance.html <span style="color: #c20cb9; font-weight: bold;">last</span>;
              <span style="color: #7a0874; font-weight: bold;">break</span>;
            <span style="color: #7a0874; font-weight: bold;">&#125;</span> 
&nbsp;
                location ~ ^<span style="color: #000000; font-weight: bold;">/</span>$ <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>-f <span style="color: #000000; font-weight: bold;">/</span>index.html<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
                    rewrite <span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span>index.html <span style="color: #c20cb9; font-weight: bold;">last</span>;
                  <span style="color: #7a0874; font-weight: bold;">&#125;</span>
                   proxy_pass  http:<span style="color: #000000; font-weight: bold;">//</span>mongrel_test;
                <span style="color: #7a0874; font-weight: bold;">&#125;</span> 
&nbsp;
                location <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>-f <span style="color: #007800;">$request_filename</span>.html<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                    proxy_pass  http:<span style="color: #000000; font-weight: bold;">//</span>mongrel_test;
                  <span style="color: #7a0874; font-weight: bold;">&#125;</span>
                  rewrite <span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> $1.html <span style="color: #c20cb9; font-weight: bold;">last</span>;
                <span style="color: #7a0874; font-weight: bold;">&#125;</span> 
&nbsp;
                location ~ .html <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                                root    <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>shovan<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>oas<span style="color: #000000; font-weight: bold;">/</span>public;
                <span style="color: #7a0874; font-weight: bold;">&#125;</span> 
&nbsp;
                   location ~<span style="color: #000000; font-weight: bold;">*</span> ^.+\.<span style="color: #7a0874; font-weight: bold;">&#40;</span>jpg|jpeg|gif|png|ico|css|<span style="color: #c20cb9; font-weight: bold;">zip</span>|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|<span style="color: #c20cb9; font-weight: bold;">tar</span>|mid|midi|wav|bmp|rtf|js|mov<span style="color: #7a0874; font-weight: bold;">&#41;</span>$ <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                  root <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>shovan<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>oas<span style="color: #000000; font-weight: bold;">/</span>public;
                <span style="color: #7a0874; font-weight: bold;">&#125;</span> 
&nbsp;
                location <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                    proxy_pass  http:<span style="color: #000000; font-weight: bold;">//</span>mongrel_test;
                    proxy_redirect     off;
                    proxy_set_header   Host             <span style="color: #007800;">$host</span>;
                    proxy_set_header   X-Real-IP        <span style="color: #007800;">$remote_addr</span>;
                    proxy_set_header   X-Forwarded-For  <span style="color: #007800;">$proxy_add_x_forwarded_for</span>;
                <span style="color: #7a0874; font-weight: bold;">&#125;</span> 
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #666666; font-style: italic;"># end of http</span></pre></div></div>

<p><strong>STEP 3</strong></p>
<p>Set up your mongrel_cluster.yml file. Here is how it should look like:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;"> <span style="color:#006600; font-weight:bold;">---</span>
cwd: <span style="color:#006600; font-weight:bold;">/</span>home<span style="color:#006600; font-weight:bold;">/</span>shovan<span style="color:#006600; font-weight:bold;">/</span>apps<span style="color:#006600; font-weight:bold;">/</span>oas
port: <span style="color:#996600;">&quot;8000&quot;</span>
environment: production
address: 127.0.0.1
pid_file: log<span style="color:#006600; font-weight:bold;">/</span>mongrel.<span style="color:#9900CC;">pid</span>
servers: <span style="color:#006666;">3</span></pre></div></div>

<p><strong>STEP 4</strong><br />
Now start the mongrel cluster using the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">sudo</span> mongrel_rails cluster::start</pre></div></div>

<p>That should fire up the clusters. Restart ngnix and you should be able to see your rails app when you load up the url in the browser. If you get errors make sure you look at the logs to see whats going on. They can be really helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.circlingminds.com/advanced-rails/using-nginx-mongrel-rails-on-ubuntu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Useful Linux Commands</title>
		<link>http://www.circlingminds.com/linux/useful-linux-commands/</link>
		<comments>http://www.circlingminds.com/linux/useful-linux-commands/#comments</comments>
		<pubDate>Sat, 22 Sep 2007 03:58:00 +0000</pubDate>
		<dc:creator>shovan</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rockclimbingutah.com/circlingminds/?p=7</guid>
		<description><![CDATA[Disk Usage
To find out disk usage in your linux box type:

df -h


Memory Usage
To get a breakdown of memory information, run

cat /proc/meminfo



To get a sum of memory(RAM) size, run

 cat /proc/meminfo &#124; grep MemTotal


Process Details
 To find details of processes that are running:

 ps -ef

 You can also do

ps -ef &#124; grep ruby

to look for any [...]]]></description>
			<content:encoded><![CDATA[<p><b>Disk Usage</b></p>
<p>To find out disk usage in your linux box type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">df</span> <span style="color: #660033;">-h</span></pre></div></div>

</p>
<p><b>Memory Usage</b></p>
<p>To get a breakdown of memory information, run</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>meminfo</pre></div></div>

</p>
<p>
To get a sum of memory(RAM) size, run</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>meminfo | <span style="color: #c20cb9; font-weight: bold;">grep</span> MemTotal</pre></div></div>

</p>
<p><b>Process Details</b></p>
<p> To find details of processes that are running:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #660033;">-ef</span></pre></div></div>

<p> You can also do</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #660033;">-ef</span> | <span style="color: #c20cb9; font-weight: bold;">grep</span> ruby</pre></div></div>

<p>to look for any ruby processes that are running on the machine.</p>
<p>
<b>List of files in a directory</b></p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> | <span style="color: #c20cb9; font-weight: bold;">wc</span> <span style="color: #660033;">-l</span></pre></div></div>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.circlingminds.com/linux/useful-linux-commands/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing Ruby bindings for SVN on Ubuntu</title>
		<link>http://www.circlingminds.com/advanced-rails/installing-ruby-bindings-for-svn-on-ubuntu/</link>
		<comments>http://www.circlingminds.com/advanced-rails/installing-ruby-bindings-for-svn-on-ubuntu/#comments</comments>
		<pubDate>Sun, 22 Jul 2007 04:02:21 +0000</pubDate>
		<dc:creator>shovan</dc:creator>
		
		<category><![CDATA[advanced-rails]]></category>

		<guid isPermaLink="false">http://www.rockclimbingutah.com/circlingminds/?p=11</guid>
		<description><![CDATA[I just spent four painful hours  trying to setup Collaboa on my Ubuntu box. I hope to share my findings hoping it will save you guys some time. 
Collaboa is a collaborative tool for developers using Subversion. It is written in rails and lets you do repository browsing, track issues, manage milestone, and view [...]]]></description>
			<content:encoded><![CDATA[<p>I just spent four painful hours <img src='http://www.circlingminds.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> trying to setup Collaboa on my Ubuntu box. I hope to share my findings hoping it will save you guys some time. </p>
<p>Collaboa is a collaborative tool for developers using Subversion. It is written in rails and lets you do repository browsing, track issues, manage milestone, and view changes.</p>
<p>First thing you need to get is the ruby bindings for subversion. Please do not try version 1.3.25. It just won&#8217;t work.</p>
<p><strong>STEP 1</strong><br />
You can download the ruby bindings for subversion <a href="http://circlingminds.com/assets/2007/11/9/swig-1.3.31.tar.gz">here</a> . </p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf swig-1.3.31.tar.gz<span style="color: #000000; font-weight: bold;">&lt;</span>br <span style="color: #000000; font-weight: bold;">/&gt;</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> .<span style="color: #000000; font-weight: bold;">/</span>swig-1.3.31<span style="color: #000000; font-weight: bold;">&lt;</span>br <span style="color: #000000; font-weight: bold;">/&gt;</span>.<span style="color: #000000; font-weight: bold;">/</span>configure<span style="color: #000000; font-weight: bold;">&lt;</span>br <span style="color: #000000; font-weight: bold;">/&gt;</span>
<span style="color: #c20cb9; font-weight: bold;">make</span><span style="color: #000000; font-weight: bold;">&lt;</span>br <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span><span style="color: #000000; font-weight: bold;">&lt;</span>br <span style="color: #000000; font-weight: bold;">/&gt;</span></pre></div></div>

<p><strong>STEP 2</strong><br />
Download and install the latest version of Subversion</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>subversion.tigris.org<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>subversion-1.4.4.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf subversion-1.4.4.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> subversion-1.4.4
.<span style="color: #000000; font-weight: bold;">/</span>configure --<span style="color: #007800;">prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span> <span style="color: #660033;">--with-openssl</span> <span style="color: #660033;">--with-ssl</span> <span style="color: #660033;">--with-zlib</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&lt;</span>br <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><strong>STEP 3</strong><br />
Now, install the Ruby subversion bindings</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> swig-rb
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> install-swig-rb
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libsvn-ruby</pre></div></div>

<p>Then start irb and do a  &lsquo;require &ldquo;svn/core&rdquo; to find out if u were able to install swig-rb properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.circlingminds.com/advanced-rails/installing-ruby-bindings-for-svn-on-ubuntu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Validations based on a Controller Method</title>
		<link>http://www.circlingminds.com/advanced-rails/validations-based-on-a-controller-method-2/</link>
		<comments>http://www.circlingminds.com/advanced-rails/validations-based-on-a-controller-method-2/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 04:03:20 +0000</pubDate>
		<dc:creator>shovan</dc:creator>
		
		<category><![CDATA[advanced-rails]]></category>

		<guid isPermaLink="false">http://www.rockclimbingutah.com/circlingminds/?p=4</guid>
		<description><![CDATA[Sometimes i have ran into a situation where there was a need to validate a new record depending upon which method was used. For example I was capturing data for an event which had both domestic and international leads.  There were different criteria for the two sets of data.  

For eg: I needed [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes i have ran into a situation where there was a need to validate a new record depending upon which method was used. For example I was capturing data for an event which had both domestic and international leads.  There were different criteria for the two sets of data.  </p>
<p>
For eg: I needed to validate presence of state, cost center for US leads and ignore those for international leads.</p>
<p>So i needed to figure out separate ways to handle the validations. Here is how I implemented it.</p>
<p>
I defined two methods in my model:  usa_validation? and international_validation?</p>

<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">  <span style="color:#008000; font-style:italic;"># validations only specific to usa leads</span>
  attr_accessor <span style="color:#ff3333; font-weight:bold;">:usa_validation</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> usa_validation?
    <span style="color:#0000FF; font-weight:bold;">return</span> usa_validation
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> usa_validation=<span style="color:#006600; font-weight:bold;">&#40;</span>value<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@usa_validation</span> = value
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  validates_presence_of <span style="color:#ff3333; font-weight:bold;">:region</span>, <span style="color:#ff3333; font-weight:bold;">:if</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:usa_validation</span>?
  validates_presence_of <span style="color:#ff3333; font-weight:bold;">:cost_center</span>, <span style="color:#ff3333; font-weight:bold;">:if</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:usa_validation</span>?
&nbsp;
  <span style="color:#008000; font-style:italic;"># validations only specific to international leads</span>
  attr_accessor <span style="color:#ff3333; font-weight:bold;">:international_validation</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> international_validation?
    <span style="color:#0000FF; font-weight:bold;">return</span> international_validation
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> usa_validation=<span style="color:#006600; font-weight:bold;">&#40;</span>value<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@usa_validation</span> = value
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  validates_presence_of <span style="color:#ff3333; font-weight:bold;">:country</span>, <span style="color:#ff3333; font-weight:bold;">:if</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:international_validation</span>?</pre></div></div>

</p>
<p>
In my controller i set the flag to true for US or international depending upon the case.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> capture_usa_lead
    <span style="color:#0066ff; font-weight:bold;">@lead</span> = Lead.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:lead</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@lead</span>.<span style="color:#9900CC;">usa_validation</span> =  <span style="color:#0000FF; font-weight:bold;">true</span>
    <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0066ff; font-weight:bold;">@lead</span>.<span style="color:#9900CC;">save</span>
      <span style="color:#008000; font-style:italic;">#display message</span>
    <span style="color:#9966CC; font-weight:bold;">else</span> 
      render  <span style="color:#ff3333; font-weight:bold;">:layout</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;lead&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:partial</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;usa_form&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> capture_international_lead
    <span style="color:#0066ff; font-weight:bold;">@lead</span> = Lead.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:lead</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@lead</span>.<span style="color:#9900CC;">international_validation</span> = <span style="color:#0000FF; font-weight:bold;">true</span>
    <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0066ff; font-weight:bold;">@lead</span>.<span style="color:#9900CC;">save</span>
            <span style="color:#008000; font-style:italic;">#display message</span>
    <span style="color:#9966CC; font-weight:bold;">else</span>
      render  <span style="color:#ff3333; font-weight:bold;">:layout</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;lead&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:partial</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;international_form&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.circlingminds.com/advanced-rails/validations-based-on-a-controller-method-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rake Commands List</title>
		<link>http://www.circlingminds.com/ruby-on-rails/rake-commands-list/</link>
		<comments>http://www.circlingminds.com/ruby-on-rails/rake-commands-list/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 03:56:35 +0000</pubDate>
		<dc:creator>shovan</dc:creator>
		
		<category><![CDATA[ruby-on-rails]]></category>

		<guid isPermaLink="false">http://www.rockclimbingutah.com/circlingminds/?p=6</guid>
		<description><![CDATA[
rake db:fixtures:load          # Load fixtures into the current environment's database.  Load specific fixtures using FIXTURES=x,y
rake db:migrate                # Migrate the database through scripts in db/migrate. Target specific version with VERSION=x
rake db:schema:dump [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">rake db:fixtures:<span style="color:#CC0066; font-weight:bold;">load</span>          <span style="color:#008000; font-style:italic;"># Load fixtures into the current environment's database.  Load specific fixtures using FIXTURES=x,y</span>
rake db:migrate                <span style="color:#008000; font-style:italic;"># Migrate the database through scripts in db/migrate. Target specific version with VERSION=x</span>
rake db:schema:dump            <span style="color:#008000; font-style:italic;"># Create a db/schema.rb file that can be portably used against any DB supported by AR</span>
rake db:schema:<span style="color:#CC0066; font-weight:bold;">load</span>            <span style="color:#008000; font-style:italic;"># Load a schema.rb file into the database</span>
rake db:sessions:clear         <span style="color:#008000; font-style:italic;"># Clear the sessions table</span>
rake db:sessions:create        <span style="color:#008000; font-style:italic;"># Creates a sessions table for use with CGI::Session::ActiveRecordStore</span>
rake db:test:clone             <span style="color:#008000; font-style:italic;"># Recreate the test database from the current environment's database schema</span>
rake db:test:clone_structure   <span style="color:#008000; font-style:italic;"># Recreate the test databases from the development structure</span>
rake db:test:prepare           <span style="color:#008000; font-style:italic;"># Prepare the test database and load the schema</span>
rake db:test:purge             <span style="color:#008000; font-style:italic;"># Empty the test database</span>
rake log:clear                 <span style="color:#008000; font-style:italic;"># Truncates all *.log files in log/ to zero bytes</span>
rake rails:freeze:edge         <span style="color:#008000; font-style:italic;"># Lock to latest Edge Rails or a specific revision with REVISION=X (ex: REVISION=4021) or a tag with TAG=Y (ex: TAG=rel_1-1-0)</span>
rake rails:freeze:gems         <span style="color:#008000; font-style:italic;"># Lock this application to the current gems (by unpacking them into vendor/rails)</span>
rake rails:unfreeze            <span style="color:#008000; font-style:italic;"># Unlock this application from freeze of gems or edge and return to a fluid use of system gems</span>
rake rails:update              <span style="color:#008000; font-style:italic;"># Update both configs, scripts and public/javascripts from Rails</span>
rake rails:update:configs      <span style="color:#008000; font-style:italic;"># Update config/boot.rb from your current rails install</span>
rake rails:update:javascripts  <span style="color:#008000; font-style:italic;"># Update your javascripts from your current rails install</span>
rake rails:update:scripts      <span style="color:#008000; font-style:italic;"># Add new scripts to the application script/ directory</span>
rake stats                     <span style="color:#008000; font-style:italic;"># Report code statistics (KLOCs, etc) from the application</span>
rake test                      <span style="color:#008000; font-style:italic;"># Test all units and functionals</span>
rake test:functionals          <span style="color:#008000; font-style:italic;"># Run the functional tests in test/functional</span>
rake test:integration          <span style="color:#008000; font-style:italic;"># Run the integration tests in test/integration</span>
rake test:plugins              <span style="color:#008000; font-style:italic;"># Run the plugin tests in vendor/plugins/**/test (or specify with PLUGIN=name)</span>
rake test:recent               <span style="color:#008000; font-style:italic;"># Test recent changes</span>
rake test:uncommitted          <span style="color:#008000; font-style:italic;"># Test changes since last checkin (only Subversion)</span>
rake test:units                <span style="color:#008000; font-style:italic;"># Run the unit tests in test/unit</span>
rake tmp:cache:clear           <span style="color:#008000; font-style:italic;"># Clears all files and directories in tmp/cache</span>
rake tmp:clear                 <span style="color:#008000; font-style:italic;"># Clear session, cache, and socket files from tmp/</span>
rake tmp:create                <span style="color:#008000; font-style:italic;"># Creates tmp directories for sessions, cache, and sockets</span>
rake tmp:pids:clear            <span style="color:#008000; font-style:italic;"># Clears all files in tmp/pids</span>
rake tmp:sessions:clear        <span style="color:#008000; font-style:italic;"># Clears all files in tmp/sessions</span>
rake tmp:sockets:clear         <span style="color:#008000; font-style:italic;"># Clears all files in tmp/sockets</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.circlingminds.com/ruby-on-rails/rake-commands-list/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Public Key Authentication</title>
		<link>http://www.circlingminds.com/linux/public-key-authentication/</link>
		<comments>http://www.circlingminds.com/linux/public-key-authentication/#comments</comments>
		<pubDate>Mon, 07 May 2007 03:59:50 +0000</pubDate>
		<dc:creator>shovan</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rockclimbingutah.com/circlingminds/?p=9</guid>
		<description><![CDATA[Using public key authentication you can save yourself the hassel of remembering and entering password everytime you try to connect to a remote server. This process requires two files: a private key and a public key that identifies the local machine and the remote host.&#160; Lets get started.
Step 1:
Enter the following command on the local [...]]]></description>
			<content:encoded><![CDATA[<p>Using <u>public key authentication</u> you can save yourself the hassel of remembering and entering password everytime you try to connect to a remote server. This process requires two files: a private key and a public key that identifies the local machine and the remote host.&nbsp; Lets get started.</p>
<h5>Step 1:</strong></h5>
<p>Enter the following command on the local machine.</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-t</span> dsa</pre></div></div>

<p>It will ask you if you want to enter a pass phare. Ignore it.</p>
<p>That command creates two files</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">i<span style="color: #7a0874; font-weight: bold;">&#41;</span> id_dsa : This is the private key
ii<span style="color: #7a0874; font-weight: bold;">&#41;</span> id_dsa.pub : public key <span style="color: #c20cb9; font-weight: bold;">which</span> you will copy to the remote host where u want to <span style="color: #c20cb9; font-weight: bold;">login</span> using the public key authentication method</pre></div></div>

<h5>Step 2:</h5>
<p>Copy the id_dsa.pub key to the remote host you want to access. </p>
<h5>Step 3:</strong></h5>
<p>Log in to the remote host and add the id_dsa.pub file to the authorized_keys file which resides in your ~/.ssh/ directory. If the file and the directory does not exist then you have to create it.</p>
<p>Syntax for adding the public key (id_dsa.pub) to the authorized_keys file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> id_rsa.pub <span style="color: #000000; font-weight: bold;">&gt;</span> authorized_keys</pre></div></div>

<p>Now try logging into the remote host. You will notice that you no longer require password to get in. This is because your machine&#8217;s public key&nbsp; is listed in the authorized_keys file that matches to your corresponding id_dsa private key that is located in your ~/.ssh folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.circlingminds.com/linux/public-key-authentication/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to setup synergy ( Mac OSX / Ubuntu)</title>
		<link>http://www.circlingminds.com/linux/how-to-setup-synergy-mac-osx-ubuntu/</link>
		<comments>http://www.circlingminds.com/linux/how-to-setup-synergy-mac-osx-ubuntu/#comments</comments>
		<pubDate>Sun, 06 May 2007 04:01:12 +0000</pubDate>
		<dc:creator>shovan</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<category><![CDATA[mac-os-x]]></category>

		<guid isPermaLink="false">http://www.rockclimbingutah.com/circlingminds/?p=10</guid>
		<description><![CDATA[With the help of Synergy one can manange  multiple computers/screens by using just one keyboard and mouse. So i found out after several painful months of using two sets of keyboard and mouse to switch between my Macbook and Ubuntu Desktop. I shall talk about the steps I took to get synergy to work [...]]]></description>
			<content:encoded><![CDATA[<p>With the help of <u><strong>Synergy</strong></u> one can manange  multiple computers/screens by using just one keyboard and mouse. So i found out after several painful months of using two sets of keyboard and mouse to switch between my Macbook and Ubuntu Desktop. I shall talk about the steps I took to get synergy to work on my Macbook and Ubuntu desktop. I chose to use my Macbook as the server and Ubuntu as the client. </p>
<p>
Hostname of my Macbook(Server):  <span style="background-color: rgb(255, 204, 0);">isis</span><br />
Hostname of my Ubuntu Desktop(Client) : <span style="background-color: rgb(255, 204, 0);">venus</span><br />
Please replace the hostnames in the following example with your correct names.</p>
<p><strong> Step 1. </strong><br />
Download and install the source code from <i>http://synergy2.sourceforge.net/</i><br />
unzip the file install it on both computers.</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><strong> Step 2 ( Configure Mac OS X server)</strong><br />
create a file called synergy.conf with the following content</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">section:  screens
<span style="color: #666666; font-style: italic;"># name the screens</span>
isis:
venus:
end
&nbsp;
section:  links
<span style="color: #666666; font-style: italic;"># telling synergy direction of the screens</span>
<span style="color: #666666; font-style: italic;"># my macbook is on the left and Ubuntu is on the right</span>
isis:
right = venus
venus:
left = isis
end</pre></div></div>

<p>
to start the synergy server</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">synergys <span style="color: #660033;">-f</span> <span style="color: #660033;">--config</span> syngery.conf</pre></div></div>

<p><strong> Step 3: ( starting Ubuntu Client)</strong><br />
Make sure you have installed synergy.Then run the following command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">synergyc <span style="color: #660033;">-f</span> isis
<span style="color: #7a0874; font-weight: bold;">&#40;</span>syngergyc <span style="color: #660033;">-f</span> hostname-of-synergy-server<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>You can also use the ip address of the synergy server.<br />
<br />
For more information visit:  http://synergy2.sourceforge.net/faq.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.circlingminds.com/linux/how-to-setup-synergy-mac-osx-ubuntu/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
