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

<channel>
	<title>Blog of Michael Gimena</title>
	<atom:link href="http://www.mgimena.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mgimena.com</link>
	<description>programming resources, coding tips and happenings</description>
	<lastBuildDate>Sat, 14 Apr 2012 09:46:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Installing brew in OS X</title>
		<link>http://www.mgimena.com/2012/04/14/installing-brew-in-os-x/</link>
		<comments>http://www.mgimena.com/2012/04/14/installing-brew-in-os-x/#comments</comments>
		<pubDate>Sat, 14 Apr 2012 09:46:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IT Related]]></category>

		<guid isPermaLink="false">http://www.mgimena.com/?p=188</guid>
		<description><![CDATA[https://github.com/mxcl/homebrew/wiki/installation http://mxcl.github.com/homebrew/]]></description>
			<content:encoded><![CDATA[<p>https://github.com/mxcl/homebrew/wiki/installation</p>
<p>http://mxcl.github.com/homebrew/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mgimena.com/2012/04/14/installing-brew-in-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IP Address blacklist checker</title>
		<link>http://www.mgimena.com/2012/03/20/ip-address-blacklist-checker/</link>
		<comments>http://www.mgimena.com/2012/03/20/ip-address-blacklist-checker/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 07:00:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IT Related]]></category>

		<guid isPermaLink="false">http://www.mgimena.com/?p=185</guid>
		<description><![CDATA[http://www.spamhaus.org/lookup/]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.spamhaus.org/lookup/">http://www.spamhaus.org/lookup/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mgimena.com/2012/03/20/ip-address-blacklist-checker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>running rake task as cronjobs &#8211; rvm</title>
		<link>http://www.mgimena.com/2012/01/31/running-rake-task-as-cronjobs/</link>
		<comments>http://www.mgimena.com/2012/01/31/running-rake-task-as-cronjobs/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 10:07:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IT Related]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.mgimena.com/?p=181</guid>
		<description><![CDATA[#!/usr/bin/env bash # load rvm ruby source /usr/local/rvm/environments/ruby-1.9.2-p290@projectX bundle install ruby /path/to/script.rb rake do something Source: http://beginrescueend.com/integration/cron/]]></description>
			<content:encoded><![CDATA[<pre>#!/usr/bin/env bash

# load rvm ruby
source /usr/local/rvm/environments/ruby-1.9.2-p290@projectX

bundle install
ruby /path/to/script.rb
rake do something</pre>
<pre>Source:<a href="http://beginrescueend.com/integration/cron/">

http://beginrescueend.com/integration/cron/</a></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mgimena.com/2012/01/31/running-rake-task-as-cronjobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails session lost when calling request via jquery/ajax</title>
		<link>http://www.mgimena.com/2012/01/08/rails-session-lost-when-calling-request-via-jqueryajax/</link>
		<comments>http://www.mgimena.com/2012/01/08/rails-session-lost-when-calling-request-via-jqueryajax/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 09:39:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IT Related]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.mgimena.com/?p=178</guid>
		<description><![CDATA[Before calling the ajax request, add this: $.ajaxSetup({ &#8216;beforeSend&#8217;: function(xhr) { xhr.setRequestHeader(&#8216;X-CSRF-Token&#8217;, $(&#8220;meta[name='csrf-token']&#8220;).attr(&#8216;content&#8217;)); } }); then you can all the ajax reqeust after that: $.ajax({ type: &#8220;POST&#8221;, url: &#8220;/your-url-here&#8221;, data:  $(form).serializeArray() }); Make sure to add this in your view template: &#60;%= csrf_meta_tag %&#62; And add this javascript : https://github.com/rails/jquery-ujs Enjoy!]]></description>
			<content:encoded><![CDATA[<p>Before calling the ajax request, add this:</p>
<div id="_mcePaste">
<div id="_mcePaste">$.ajaxSetup({</div>
<div id="_mcePaste">&#8216;beforeSend&#8217;: function(xhr) { xhr.setRequestHeader(&#8216;X-CSRF-Token&#8217;, $(&#8220;meta[name='csrf-token']&#8220;).attr(&#8216;content&#8217;)); }</div>
<div id="_mcePaste">});</div>
</div>
<div></div>
<div>then you can all the ajax reqeust after that:</div>
<div></div>
<div>$.ajax({</div>
<div>type: &#8220;POST&#8221;,</div>
<div>url: &#8220;/your-url-here&#8221;,</div>
<div>data:  $(form).serializeArray()</div>
<div>});</div>
<div></div>
<div>Make sure to add this in your view template:</div>
<div>&lt;%= csrf_meta_tag %&gt;</div>
<div></div>
<div>And add this javascript :<br />
<span style="line-height: normal; white-space: pre-wrap;">https://github.com/rails/jquery-ujs</span></div>
<div></div>
<div></div>
<div><span style="line-height: normal; white-space: pre-wrap;">Enjoy!</span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.mgimena.com/2012/01/08/rails-session-lost-when-calling-request-via-jqueryajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting error &#8220;Library not loaded: libmysqlclient.18.dylib (LoadError)&#8221; on Mac</title>
		<link>http://www.mgimena.com/2011/10/11/getting-error-library-not-loaded-libmysqlclient-18-dylib-loaderror-on-mac/</link>
		<comments>http://www.mgimena.com/2011/10/11/getting-error-library-not-loaded-libmysqlclient-18-dylib-loaderror-on-mac/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 14:10:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IT Related]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.mgimena.com/?p=173</guid>
		<description><![CDATA[On OSX, I&#8217;ve installed  RVM, ruby 1.9.2, mysql2 gem, Rails 3.1.0. When starting rails server, I&#8217;m getting the following errors: `require&#8217;: dlopen(/Users/mike/myapp/ruby/1.9.2/gems/mysql2-0.3.6/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError) This simply solved my problem: $ export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH Source: http://rorguide.blogspot.com/2011/07/getting-error-library-not-loaded.html]]></description>
			<content:encoded><![CDATA[<p>On OSX, I&#8217;ve installed  RVM, ruby 1.9.2, mysql2 gem, Rails 3.1.0. When starting rails server, I&#8217;m getting the following errors:</p>
<p>`require&#8217;: dlopen(/Users/mike/myapp/ruby/1.9.2/gems/mysql2-0.3.6/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)<br />
<strong>This simply solved my problem:</strong></p>
<p>$ export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH</p>
<p>Source: <a href="http://rorguide.blogspot.com/2011/07/getting-error-library-not-loaded.html">http://rorguide.blogspot.com/2011/07/getting-error-library-not-loaded.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mgimena.com/2011/10/11/getting-error-library-not-loaded-libmysqlclient-18-dylib-loaderror-on-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Redis 2.2.4 on Ubuntu 10.10 &amp; 11.04 and running with an ‘init’ script.</title>
		<link>http://www.mgimena.com/2011/10/02/installing-redis-2-2-4-on-ubuntu-10-10-11-04-and-running-with-an-%e2%80%98init%e2%80%99-script/</link>
		<comments>http://www.mgimena.com/2011/10/02/installing-redis-2-2-4-on-ubuntu-10-10-11-04-and-running-with-an-%e2%80%98init%e2%80%99-script/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 04:32:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IT Related]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.mgimena.com/?p=171</guid>
		<description><![CDATA[Following on from previous post on installing MongoDB 1.8.1, here are similar steps to getting Redis 2.2.4 running on Ubuntu 10.10 using an init script. The setup is intended to be used on developer desktop/laptop rather than production infrastructure. As ever, first download and unzip Redis from here. cd /tmp wget http://redis.googlecode.com/files/redis-2.2.4.tar.gz tar -zxf redis-2.2.4.tar.gz cd redis-2.2.4 [...]]]></description>
			<content:encoded><![CDATA[<p>Following on from <a href="http://www.denofubiquity.com/nosql/398/">previous post on installing MongoDB 1.8.1</a>, here are similar steps to getting Redis 2.2.4 running on Ubuntu 10.10 using an init script. The setup is intended to be used on developer desktop/laptop rather than production infrastructure.</p>
<p>As ever, first download and unzip Redis from <a href="http://redis.io/download">here</a>.</p>
<pre>cd /tmp
wget http://redis.googlecode.com/files/redis-2.2.4.tar.gz
tar -zxf redis-2.2.4.tar.gz
cd redis-2.2.4
make
sudo make install</pre>
<p>Your Redis binaries should now be located in /usr/local/bin.</p>
<p>To get an init script and Redis config working cleanly with this setup, download my init and config files from <a href="https://github.com/ijonas/dotfiles/">my Github ‘dotfiles’ repo</a>. My init script is pretty standard. However my redis.conf sets Redis up with 1Gb of virtual memory and 20Gb of swap space – intended for general development purposes.</p>
<pre>wget https://github.com/ijonas/dotfiles/raw/master/etc/init.d/redis-server
wget https://github.com/ijonas/dotfiles/raw/master/etc/redis.conf
sudo mv redis-server /etc/init.d/redis-server
sudo chmod +x /etc/init.d/redis-server
sudo mv redis.conf /etc/redis.conf</pre>
<p>Before you can fire up the Redis server for the first time, you’ll need add a redis user and prep a data and logging folder.</p>
<pre>sudo useradd redis
sudo mkdir -p /var/lib/redis
sudo mkdir -p /var/log/redis
sudo chown redis.redis /var/lib/redis
sudo chown redis.redis /var/log/redis</pre>
<p>Also, you need to activate your Redis services init script by adding it to your system’s run-level configuration. That way the service will startup during the boot sequence and stop nicely during the OS’ shutdown procedure.</p>
<pre>sudo update-rc.d redis-server defaults</pre>
<p>You’re now ready to launch Redis server with</p>
<pre>sudo /etc/init.d/redis-server start</pre>
<p>Good luck!</p>
<p>Source: <a href="http://www.denofubiquity.com/nosql/412/">http://www.denofubiquity.com/nosql/412/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mgimena.com/2011/10/02/installing-redis-2-2-4-on-ubuntu-10-10-11-04-and-running-with-an-%e2%80%98init%e2%80%99-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery with Rails</title>
		<link>http://www.mgimena.com/2011/09/26/jquery-with-rails/</link>
		<comments>http://www.mgimena.com/2011/09/26/jquery-with-rails/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 10:38:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.mgimena.com/?p=167</guid>
		<description><![CDATA[If you encounter same problem i have mine where :confirm does not work in: &#60;%= link_to &#8220;Delete&#8221;,  location, ;confirm =&#62; &#8220;Are you sure?&#8221; %&#62; Solution: 1) Grab the jQuery driver at http://github.com/rails/jquery-ujs and put it in your javascripts directory. The file is at src/rails.js 2) Put these codes to your layout file: = javascript_include_tag &#8220;http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>If you encounter same problem i have mine where :confirm does not work in:</p>
<p>&lt;%= link_to &#8220;Delete&#8221;,  location, ;confirm =&gt; &#8220;Are you sure?&#8221; %&gt;</p>
<p>Solution:</p>
<p>1) Grab the jQuery driver at http://github.com/rails/jquery-ujs and put it in your javascripts directory. The file is at src/rails.js</p>
<p>2) Put these codes to your layout file:</p>
<p>= javascript_include_tag &#8220;http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js&#8221;<br />
= javascript_include_tag &#8216;rails&#8217;</p>
<p>3) to authenticate ajax request from CSRF attack add this to your header :</p>
<p>&lt;%= csrf_meta_tag %&gt;</p>
<p>More information at: <a href="http://joshhuckabee.com/jquery-rails-3">http://joshhuckabee.com/jquery-rails-3</a></p>
<p><a href="http://joshhuckabee.com/jquery-rails-3"></a>Enjoy! <img src='http://www.mgimena.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mgimena.com/2011/09/26/jquery-with-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails session is removed when submitting a form via Ajax-Jquery</title>
		<link>http://www.mgimena.com/2011/09/25/rails-session-is-removed-when-submitting-a-form-via-ajax-jquery/</link>
		<comments>http://www.mgimena.com/2011/09/25/rails-session-is-removed-when-submitting-a-form-via-ajax-jquery/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 01:59:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.mgimena.com/?p=164</guid>
		<description><![CDATA[I have encountered this just recently and this just solved the problem. Add the codes below to your application.js function CSRFProtection(xhr) { var token = $(&#8216;meta[name="csrf-token"]&#8216;).attr(&#8216;content&#8217;); if (token) xhr.setRequestHeader(&#8216;X-CSRF-Token&#8217;, token); } if (&#8216;ajaxPrefilter&#8217; in $) $.ajaxPrefilter(function(options, originalOptions, xhr) { CSRFProtection(xhr); }); else $(document).ajaxSend(function(e, xhr) { CSRFProtection(xhr); }); function CSRFProtection(xhr) {   var token = $(&#8216;meta[name="csrf-token"]&#8216;).attr(&#8216;content&#8217;);    [...]]]></description>
			<content:encoded><![CDATA[<p>I have encountered this just recently and this just solved the problem. Add the codes below to your application.js</p>
<p>function CSRFProtection(xhr) {</p>
<div id="_mcePaste">var token = $(&#8216;meta[name="csrf-token"]&#8216;).attr(&#8216;content&#8217;);</div>
<div id="_mcePaste">if (token) xhr.setRequestHeader(&#8216;X-CSRF-Token&#8217;, token);</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">if (&#8216;ajaxPrefilter&#8217; in $) $.ajaxPrefilter(function(options, originalOptions, xhr) { CSRFProtection(xhr); });</div>
<div id="_mcePaste">else $(document).ajaxSend(function(e, xhr) { CSRFProtection(xhr); });</div>
<p>function CSRFProtection(xhr) {   var token = $(&#8216;meta[name="csrf-token"]&#8216;).attr(&#8216;content&#8217;);    if (token) xhr.setRequestHeader(&#8216;X-CSRF-Token&#8217;, token);}if (&#8216;ajaxPrefilter&#8217; in $) $.ajaxPrefilter(function(options, originalOptions, xhr) { CSRFProtection(xhr); });else $(document).ajaxSend(function(e, xhr) { CSRFProtection(xhr); });</p>
<p>Hope this helps <img src='http://www.mgimena.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mgimena.com/2011/09/25/rails-session-is-removed-when-submitting-a-form-via-ajax-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing RMagick on Ubuntu</title>
		<link>http://www.mgimena.com/2011/09/18/installing-rmagick-on-ubuntu/</link>
		<comments>http://www.mgimena.com/2011/09/18/installing-rmagick-on-ubuntu/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 01:06:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IT Related]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.mgimena.com/?p=162</guid>
		<description><![CDATA[$ sudo aptitude install -y imagemagick $ sudo aptitude install -y libmagick9-dev $ sudo gem install rmagick]]></description>
			<content:encoded><![CDATA[<pre>$ sudo aptitude install -y imagemagick
$ sudo aptitude install -y libmagick9-dev
$ sudo gem install rmagick</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mgimena.com/2011/09/18/installing-rmagick-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql problem when bundling</title>
		<link>http://www.mgimena.com/2011/09/06/mysql-problem-when-bundling/</link>
		<comments>http://www.mgimena.com/2011/09/06/mysql-problem-when-bundling/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 04:52:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.mgimena.com/?p=159</guid>
		<description><![CDATA[Problem encountered: Installing mysql2 (0.2.13) with native extensions /home/mike/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions&#8217;: ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /home/mike/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb checking for rb_thread_blocking_region()&#8230; yes checking for mysql_query() in -lmysqlclient&#8230; no checking for main() in -lm&#8230; yes checking for mysql_query() in -lmysqlclient&#8230; no checking for main() in -lz&#8230; yes checking for mysql_query() [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem encountered:</strong></p>
<p>Installing mysql2 (0.2.13) with native extensions /home/mike/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions&#8217;: ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)</p>
<p>/home/mike/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb<br />
checking for rb_thread_blocking_region()&#8230; yes<br />
checking for mysql_query() in -lmysqlclient&#8230; no<br />
checking for main() in -lm&#8230; yes<br />
checking for mysql_query() in -lmysqlclient&#8230; no<br />
checking for main() in -lz&#8230; yes<br />
checking for mysql_query() in -lmysqlclient&#8230; no<br />
checking for main() in -lsocket&#8230; no<br />
checking for mysql_query() in -lmysqlclient&#8230; no<br />
checking for main() in -lnsl&#8230; yes<br />
checking for mysql_query() in -lmysqlclient&#8230; no<br />
checking for main() in -lmygcc&#8230; no<br />
checking for mysql_query() in -lmysqlclient&#8230; no<br />
*** extconf.rb failed ***<br />
Could not create Makefile due to some reason, probably lack of<br />
necessary libraries and/or headers.  Check the mkmf.log file for more<br />
details.  You may need configuration options.</p>
<p><strong>Solution:</strong></p>
<p>sudo apt-get install libmysqlclient15-dev</p>
<p>Then bundle install again and it should work.! <img src='http://www.mgimena.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mgimena.com/2011/09/06/mysql-problem-when-bundling/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

