<?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>Joseph Wahba</title>
	<atom:link href="http://www.josephwahba.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.josephwahba.com</link>
	<description>Rambling Mind</description>
	<lastBuildDate>Fri, 23 Mar 2012 21:04:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Change file/folder owner in linux</title>
		<link>http://www.josephwahba.com/2012/03/change-filefolder-owner-in-linux/</link>
		<comments>http://www.josephwahba.com/2012/03/change-filefolder-owner-in-linux/#comments</comments>
		<pubDate>Sat, 17 Mar 2012 16:14:03 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[file access]]></category>

		<guid isPermaLink="false">http://www.josephwahba.com/?p=94</guid>
		<description><![CDATA[To change the owner of a file/folder in Linux Example: the folder stats has the root as owner and we need to change the owner of user1 chown -R user1 stats This will change the owner of the folder and &#8230; <a href="http://www.josephwahba.com/2012/03/change-filefolder-owner-in-linux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>To change the owner of a file/folder in Linux</p>
<p>Example: the folder <strong>stats</strong> has the <strong>root</strong> as owner and we need to change the owner of <strong>user1</strong></p>
<pre>chown -R user1 stats</pre>
<p>This will change the owner of the folder and all subfolders and files</p>
]]></content:encoded>
			<wfw:commentRss>http://www.josephwahba.com/2012/03/change-filefolder-owner-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Ruby on Rails on Ubuntu 11.10 (Oneiric Ocelot)</title>
		<link>http://www.josephwahba.com/2012/03/install-ruby-on-rails-on-ubuntu-10-10-oneiric-ocelot/</link>
		<comments>http://www.josephwahba.com/2012/03/install-ruby-on-rails-on-ubuntu-10-10-oneiric-ocelot/#comments</comments>
		<pubDate>Sat, 17 Mar 2012 15:46:48 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[Oneiric Ocelot]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.josephwahba.com/?p=82</guid>
		<description><![CDATA[Getting Ruby on Rails install on your Ubuntu development machine is easy Install Required Libraries sudo apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion Install Required &#8230; <a href="http://www.josephwahba.com/2012/03/install-ruby-on-rails-on-ubuntu-10-10-oneiric-ocelot/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Getting Ruby on Rails install on your Ubuntu development machine is easy</p>
<ol>
<li>Install Required Libraries
<pre>sudo apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion</pre>
</li>
<li>Install Required Tools<br />
Installing Git</p>
<pre>sudo apt-get install git</pre>
<p>Installing Curl</p>
<pre>sudo apt-get install curl</pre>
</li>
<li>Install RVM and Ruby
<pre>bash -s stable &lt; &lt;(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)</pre>
<p>Run the following command</p>
<pre>source ~/.rvm/scripts/rvm</pre>
<p>Run the following command to install ruby 1.9.2</p>
<pre>rvm install 1.9.2</pre>
<p>Set the default Ruby version</p>
<pre>rvm --default use 1.9.2</pre>
</li>
<li>Install Rails
<pre>gem install rails</pre>
</li>
<li>Install Common Gems
<pre>gem install devise
gem install rspec
gem install cucumber
gem install factory_girl_rails
gem install faker</pre>
</li>
</ol>
<p>Congratulation, you got your development environment setup</p>
]]></content:encoded>
			<wfw:commentRss>http://www.josephwahba.com/2012/03/install-ruby-on-rails-on-ubuntu-10-10-oneiric-ocelot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The hunger games and Egypt &#8220;Revolution&#8221;</title>
		<link>http://www.josephwahba.com/2012/02/the-hunger-games-and-egypt-revolution/</link>
		<comments>http://www.josephwahba.com/2012/02/the-hunger-games-and-egypt-revolution/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 18:45:58 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Book Review]]></category>
		<category><![CDATA[Egypt]]></category>
		<category><![CDATA[The Hunger Games]]></category>

		<guid isPermaLink="false">http://www.josephwahba.com/?p=72</guid>
		<description><![CDATA[Hunger Games.. awesome read Last month I found myself drawn into this amazing trilogy audio books. I started to listen to it to kill time in my ugly daily commute but i found my self completely consumed by it. Partly &#8230; <a href="http://www.josephwahba.com/2012/02/the-hunger-games-and-egypt-revolution/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hunger Games.. awesome read<br />
Last month I found myself drawn into this amazing trilogy audio books. I started to listen to it to kill time in my ugly daily commute but i found my self completely consumed by it. Partly because it&#8217;s easy language and the unexpected turns of events which makes my 1 hour drive a bit less painful, But after a while I started to notice a pattern and suddenly &#8230;.. Egypt<br />
The trilogy is 3 books, 400 pages each, full of details and events but out of these, one line of events stood out clearly &#8220;<strong>the rebellion</strong>&#8221;<br />
The story project almost perfectly Egypt revolutions starting from the fifties<br />
The Story Line<br />
Someday in the future the whole civilization is shrunk to 13 districts and the capital. the 13 districts were living in poor conditions while doing the hard work for the capital such as mining, manufacturing, agriculture&#8230;<br />
At some point they decided to stand against the Capital, which result in a destruction of district 13 and initiation of the hunger games where every year the capital get randomly a boy and a girl from each district and let them fight in an arena till only one of them is alive. The Hunger games was an entertainment for the Capital people and a reminder for the district of the capital superiority. One of these years a girl (Katniss) and a boy from district 12 got into the game and stayed alive till the very end of the game not playing by the capital rules they wanted to be announced vector together. This action (whoever small it is) was considered the spark that initiated the rebellion in all 12 districts again.<br />
Long story short, while the people of the districts were fighting the capital they found out that district 13 was not completely destroyed but they managed to have a deal with the capital all these years to stay hidden and the capital leave them alone or else they will launch there nuclear missiles towards the capital.<br />
After a lot of fighting and death from districts people now led by district 13 (and it&#8217;s president) inspired by the girl who won the games . They managed to defeat the capital (and president of district 13 as a ruler of course) only to find themselves falling into a loop where a new version of the hunger games starting.</p>
<p>Sound familiar&#8230;.. hah<br />
Of course this is just a very skimmed version of the story but the more details you read the more resemblance you find.<br />
Capital, district 13, secret deals, power and rebellion. These are all just too familiar<br />
All I can hope for is that the end o story in Egypt is better than the one in the book</p>
]]></content:encoded>
			<wfw:commentRss>http://www.josephwahba.com/2012/02/the-hunger-games-and-egypt-revolution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing your apache &#8211; Part 1 (Hiding Server banner)</title>
		<link>http://www.josephwahba.com/2012/01/securing-your-apache-server-part-1-hiding-server-banner/</link>
		<comments>http://www.josephwahba.com/2012/01/securing-your-apache-server-part-1-hiding-server-banner/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 18:54:21 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.josephwahba.com/?p=60</guid>
		<description><![CDATA[The first thing that the hacker will do while attacking your web application is to get information about your web server. Using netcat tool is pretty easy even for script kiddies. For example firing the next simple command can get &#8230; <a href="http://www.josephwahba.com/2012/01/securing-your-apache-server-part-1-hiding-server-banner/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The first thing that the hacker will do while attacking your web application is to get information about your web server. Using netcat tool is pretty easy even for script kiddies. For example firing the next simple command can get the web server brand, version name and operating system</p>
<pre>nc xxx.xxx.xxx.xxx 80
HEAD / HTTP/1.0</pre>
<p>Here is the result</p>
<pre>HTTP/1.1 200 OK
Date: Fri, 20 Jan 2012 14:24:08 GMT
<strong>Server: Apache/2.2.16 (Debian)</strong>
Last-Modified: Tue, 15 Nov 2011 09:24:49 GMT
ETag: "180d5-b1-4b1c28f12fa40"
Accept-Ranges: bytes
Content-Length: 177
Vary: Accept-Encoding
Connection: close
Content-Type: text/html</pre>
<p>As you can see some dangerous information are available about the web server.<br />
Also if you tried to request a non-existing page the server will respond with full details about it and the host OS</p>
<pre><strong>Not Found </strong>
The requested URL /hack-test was not found on this server.

Apache/2.2.20 (Unix) DAV/2 PHP/5.3.6 with Suhosin-Patch Server at localhost Port 80</pre>
<p>Fortunately a mitigation for such a leakage in apache is simple</p>
<ol>
<li>To hide server details shown when you request a non-existing page, you need to add the following line to httpd.conf (or whatever the apache configuration file name)
<pre>ServerSignature Off</pre>
<p>This will remove the server details from the page</li>
<li>To hide server details from the response header, you need to install mod_security module for apache (in Debian servers the task is easy enough)
<pre>apt-get install libapache2-mod-security2</pre>
<p>then add the following line to httpd.conf (or whatever the apache configuration file name)</p>
<pre>ServerTokens Full
SecServerSignature "Web Server"</pre>
<p>This will show the word &#8220;Web Server&#8221; instead of you full server details</li>
</ol>
<p>Sure there are other ways to determine the server banner using fingerprinting, but this will be for another post</p>
]]></content:encoded>
			<wfw:commentRss>http://www.josephwahba.com/2012/01/securing-your-apache-server-part-1-hiding-server-banner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seeding rails application with data</title>
		<link>http://www.josephwahba.com/2012/01/seeding-rails-application-with-data/</link>
		<comments>http://www.josephwahba.com/2012/01/seeding-rails-application-with-data/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 18:51:01 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[faker]]></category>
		<category><![CDATA[rubygem]]></category>

		<guid isPermaLink="false">http://www.josephwahba.com/?p=54</guid>
		<description><![CDATA[While development I like to have some sample data for testing and demo purposes. Instead filling them out using application interface, rails console or database operation rails has a slick way of seeding your database. When you create a new &#8230; <a href="http://www.josephwahba.com/2012/01/seeding-rails-application-with-data/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While development I like to have some sample data for testing and demo purposes. Instead filling them out using application interface, rails console or database operation rails has a slick way of seeding your database.</p>
<p>When you create a new rails application you can find a file called seeds.rb on db directory. This file can contain all your seeding data as follows</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p54code5'); return false;">View Code</a> RUBY</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p545"><td class="code" id="p54code5"><pre class="ruby" style="font-family:monospace;">projects = Project.<span style="color:#9900CC;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#123;</span>:title =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'xxxxx'</span>, <span style="color:#ff3333; font-weight:bold;">:description</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'yyyyyyyy'</span><span style="color:#006600; font-weight:bold;">&#125;</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>:title =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'rrrrrrrrr'</span>, <span style="color:#ff3333; font-weight:bold;">:description</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'zzzzzzzzzzzzz'</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p>To execute this file and fill your database with seeding data run</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p54code6'); return false;">View Code</a> CMD</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p546"><td class="code" id="p54code6"><pre class="cmd" style="font-family:monospace;">rake db:seed</pre></td></tr></table></div>

<p>Note that if you run it more than once you&#8217;ll have your data filled twice in the database, to reset your database run</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p54code7'); return false;">View Code</a> CMD</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p547"><td class="code" id="p54code7"><pre class="cmd" style="font-family:monospace;">rake db:reset</pre></td></tr></table></div>

<p>Having your seeding data in ruby file can give you some advantages as you can use loops to fill data series or use other tools such as Faker. To use faker with your seed data:</p>
<p>1- Add <strong>gem &#8216;faker&#8217; </strong>to your Gemfile</p>
<p>2- Add <strong>require &#8216;faker&#8217;</strong> on top of seeds.rb</p>
<p>3- Use faker in your seed data</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p54code8'); return false;">View Code</a> RUBY</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p548"><td class="code" id="p54code8"><pre class="ruby" style="font-family:monospace;">projects = Project.<span style="color:#9900CC;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#123;</span>:title =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#996600;">'xxxxx'</span>, <span style="color:#ff3333; font-weight:bold;">:description</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#6666ff; font-weight:bold;">Faker::Lorem</span>.<span style="color:#9900CC;">paragraph</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">10</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.josephwahba.com/2012/01/seeding-rails-application-with-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing port number for Central Administration site</title>
		<link>http://www.josephwahba.com/2012/01/changing-port-number-for-central-administration-site/</link>
		<comments>http://www.josephwahba.com/2012/01/changing-port-number-for-central-administration-site/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 18:47:20 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[administration]]></category>

		<guid isPermaLink="false">http://www.josephwahba.com/?p=49</guid>
		<description><![CDATA[I posted this trick in an older blog but recently I was in a situation where is was in desperate need for it, here is the old post I always like to have a standard port number for Central Administration accross &#8230; <a href="http://www.josephwahba.com/2012/01/changing-port-number-for-central-administration-site/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I posted this trick in an older blog but recently I was in a situation where is was in desperate need for it, here is the old post</p>
<p>I always like to have a standard port number for Central Administration accross all my WSS/MOSS instalations. I always use the following command to change it to my standard 1000</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p49code10'); return false;">View Code</a> CMD</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4910"><td class="code" id="p49code10"><pre class="cmd" style="font-family:monospace;">stsdm -o setadminport -port 1000</pre></td></tr></table></div>

<p>It might be unsafe to change the port number as it might break something but so far nothing broken for me</p>
]]></content:encoded>
			<wfw:commentRss>http://www.josephwahba.com/2012/01/changing-port-number-for-central-administration-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install rmagick gem on windows 7</title>
		<link>http://www.josephwahba.com/2012/01/install-rmagick-gem-on-windows-7/</link>
		<comments>http://www.josephwahba.com/2012/01/install-rmagick-gem-on-windows-7/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 17:26:29 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[rmagick]]></category>
		<category><![CDATA[rubygem]]></category>

		<guid isPermaLink="false">http://www.josephwahba.com/?p=47</guid>
		<description><![CDATA[My MacBook Pro was broken few days ago and i had to deal with the pain of rails programming on windows 7  one of the biggest pain I stumbled upon was getting rmagic gem to work on the windows machine. &#8230; <a href="http://www.josephwahba.com/2012/01/install-rmagick-gem-on-windows-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My MacBook Pro was broken few days ago and i had to deal with the pain of rails programming on windows 7 <img src="http://www.josephwahba.com/wp-includes/images/smilies/icon_sad.gif" alt=":(" /></p>
<p>one of the biggest pain I stumbled upon was getting rmagic gem to work on the windows machine. It took me about 8 hours to figure out how it is done.</p>
<ol>
<li>Install ruby DevKit <a href="http://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe">http://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe</a></li>
<li>Install ImageMagick 6.6.x with windows installer with headers <a href="http://www.imagemagick.org/download/binaries/ImageMagick-6.7.3-3-Q16-windows-dll.exe">http://www.imagemagick.org/download/binaries/ImageMagick-6.7.3-3-Q16-windows-dll.exe</a> (You should change the installation folder to c:\ImageMagic otherwise it won&#8217;t work)</li>
<li>Set the following Environment variables<br />
set PATH = c:\ImageMagic;%PATH%<br />
set CPATH = c:\ImageMagic;%CPATH%<br />
set LIBRARY_PATH=c:\ImageMagic\lib;%LIBRARY_PATH%</li>
<li>gem install rmagick<br />
This will install the latest rmagick (in this case 2.13.1)</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.josephwahba.com/2012/01/install-rmagick-gem-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Year Resolutions 2012</title>
		<link>http://www.josephwahba.com/2012/01/new-year-resolutions-2012/</link>
		<comments>http://www.josephwahba.com/2012/01/new-year-resolutions-2012/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 15:12:18 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Lifestyle]]></category>

		<guid isPermaLink="false">http://www.josephwahba.com/?p=43</guid>
		<description><![CDATA[Every year before it starts I make a list things I need to achieve by the end of the year (commitments, goals,&#8230;). Rarely I check all of them out by the ond of the year (if I manage to check &#8230; <a href="http://www.josephwahba.com/2012/01/new-year-resolutions-2012/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Every year before it starts I make a list things I need to achieve by the end of the year (commitments, goals,&#8230;). Rarely I check all of them out by the ond of the year (if I manage to check any thing at all <img src='http://www.josephwahba.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).<br />
This year I decided to publish my list online for two reasons:</p>
<ol>
<li>This approach should help me keeping my promises to avoid public humiliation</li>
<li> It should force be to create a realistic list to avoid keeping me stressed all year long.</li>
</ol>
<p>Here is my list for this year</p>
<ul>
<li>Getting married: should be easy as I&#8217;m already engaged and the weeding date is set (yes I&#8217;m cheating in my list <img src='http://www.josephwahba.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</li>
<li>Finish my CSSLP certification</li>
<li>Finish my secret new project (shhhhh)</li>
<li>Loose 12 Kg</li>
<li>Go cycling at least twice a week</li>
<li>Ge to gym at least 3 times a week</li>
<li>Eat Healthy</li>
<li>Write more Rails code</li>
<li>Every line of code should have a unit test</li>
<li>Publish more technical blog posts (at least once a week)</li>
<li>Learn French</li>
</ul>
<p>Happy New Year</p>
]]></content:encoded>
			<wfw:commentRss>http://www.josephwahba.com/2012/01/new-year-resolutions-2012/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Happy singleton</title>
		<link>http://www.josephwahba.com/2011/12/happy-singleton/</link>
		<comments>http://www.josephwahba.com/2011/12/happy-singleton/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 19:07:54 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.josephwahba.com/?p=27</guid>
		<description><![CDATA[I love Ruby (Well&#8230;., only the programming language, I actually hate the stone) I don&#8217;t know what makes this programming language special to me, but I would like to share a small ahh moment i had while reading about ruby &#8230; <a href="http://www.josephwahba.com/2011/12/happy-singleton/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I love Ruby (Well&#8230;., only the programming language, I actually hate the stone)</p>
<p>I don&#8217;t know what makes this programming language special to me, but I would like to share a small ahh moment i had while reading about ruby</p>
<p>We are all familiar with the standard GOF implementation for singleton</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p27code13'); return false;">View Code</a> RUBY</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2713"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code" id="p27code13"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC00FF; font-weight:bold;">Logger</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> initialize
    <span style="color:#0066ff; font-weight:bold;">@log</span> = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;log.txt&quot;</span>, <span style="color:#996600;">&quot;a&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  @@instance = <span style="color:#CC00FF; font-weight:bold;">Logger</span>.<span style="color:#9900CC;">new</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">instance</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> @@instance
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> log<span style="color:#006600; font-weight:bold;">&#40;</span>msg<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@log</span>.<span style="color:#CC0066; font-weight:bold;">puts</span><span style="color:#006600; font-weight:bold;">&#40;</span>msg<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  private_class_method <span style="color:#ff3333; font-weight:bold;">:new</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>That&#8217;s is the plain old singleton but with some Ruby magic it can be like this</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p27code14'); return false;">View Code</a> RUBY</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2714"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code" id="p27code14"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC00FF; font-weight:bold;">Logger</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> initialize
    <span style="color:#0066ff; font-weight:bold;">@log</span> = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;log.txt&quot;</span>, <span style="color:#996600;">&quot;a&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  @@instance = <span style="color:#CC00FF; font-weight:bold;">Logger</span>.<span style="color:#9900CC;">new</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">instance</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> @@instance
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> log<span style="color:#006600; font-weight:bold;">&#40;</span>msg<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@log</span>.<span style="color:#CC0066; font-weight:bold;">puts</span><span style="color:#006600; font-weight:bold;">&#40;</span>msg<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  private_class_method <span style="color:#ff3333; font-weight:bold;">:new</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>It is some of these small things that brings me closer to Ruby every day</p>
]]></content:encoded>
			<wfw:commentRss>http://www.josephwahba.com/2011/12/happy-singleton/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pragmatic approach to learn Ruby on Rails</title>
		<link>http://www.josephwahba.com/2011/12/pragmatic-approach-to-learn-ruby-on-rails/</link>
		<comments>http://www.josephwahba.com/2011/12/pragmatic-approach-to-learn-ruby-on-rails/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 07:39:26 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.josephwahba.com/?p=20</guid>
		<description><![CDATA[Three years ago out of bore and frustration with .Net framework while cruising on the web I stumbled upon Ruby on Rails, and from the first moment it clicked. I started to learn the framework and felt in love with &#8230; <a href="http://www.josephwahba.com/2011/12/pragmatic-approach-to-learn-ruby-on-rails/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Three years ago out of bore and frustration with .Net framework while cruising on the web I stumbled upon Ruby on Rails, and from the first moment it clicked. I started to learn the framework and felt in love with it. I was working on and off with it for the last 3 years mostly due to the lake of Rails project (most of people still attached to other famous technologies)</p>
<p>Here I want to share the learning approach that will get you up to speed with RoR with minimal frustration.</p>
<p>To be able to explain my approach I will have to explain what is RoR briefly, Ruby on Rails is a web development framework built using Ruby language.<br />
First step here is to learn the language</p>
<h2>Learning Ruby</h2>
<ol>
<li>Setup your system: RoR work best on Linux/Unix/Mac os (but it also work fine on windows platform). if you want to have the best experience without investing much money you can install Linux as a virtual machine on your system or clear 20 GB on your hard drive and install it directly on your computer (My favorit approach). My recommended Linux distribution is <a title="Ubuntu" href="www.ubuntu.com" target="_blank">Ubuntu</a></li>
<li>If you installed linux and needs to be familiar with it you can use <a title="this pdf" href="http://tldp.org/LDP/intro-linux/intro-linux.pdf" target="_blank">this pdf</a> to introduce you to the mysteries world of linux</li>
<li>If you installed Linux you can google the installation approach (will introduce it in a later post). and if you will use your windows system you need to install it using <a title="Ruby installer" href="http://rubyinstaller.org/" target="_blank">ruby installer</a> at this time the recommended version is 1.9.2 p290. Mac machines comes already with Ruby interpreter installed.</li>
<li>After setting up the environment the following resources have proved really helpful.<br />
<a title="why's (poignant) Guide to Ruby" href="http://www.rubyinside.com/media/poignant-guide.pdf" target="_blank"> why&#8217;s (poignant) Guide to Ruby<br />
</a><a title="Learning Ruby (O'Reilly)" href="http://shop.oreilly.com/product/9780596529864.do" target="_blank">Learning Ruby (O&#8217;Reilly)</a></li>
</ol>
<h2>Learning Rails</h2>
<ol>
<li>First step is to write a very basic rails application and see how it works, the following link is my first choice to see RoR in action.<br />
<a title="http://guides.rubyonrails.org/getting_started.html" href="http://guides.rubyonrails.org/getting_started.html">http://guides.rubyonrails.org/getting_started.html</a></li>
<li>I would recommend building a simple application (such as a blog, Task management&#8230;) without worrying so much about writing tests just to get yourself familiar with Rails environment.</li>
<li>Authentication is a must in almost all project you can use the instructions in the following screencast to add authentication aspect to your application<br />
<a title="http://railscasts.com/episodes/209-introducing-devise" href="http://railscasts.com/episodes/209-introducing-devise" target="_blank">http://railscasts.com/episodes/209-introducing-devise </a> or in text format<br />
<a title="http://www.asciicasts.com/episodes/209-introducing-devise" href="http://www.asciicasts.com/episodes/209-introducing-devise" target="_blank">http://www.asciicasts.com/episodes/209-introducing-devise</a></li>
<li>Now you have an overview how RoR works and created a simple demo application. Make sure you go through most of the materials on <a title="http://guides.rubyonrails.org/" href="http://guides.rubyonrails.org/" target="_blank">Ruby Guides</a> and familiarize yourself with Testing Rails Applications guide.</li>
<li>Pick a real project and fire your command line and start programming</li>
<li>Start using rSpec &#038; Cucumber into your projects to create better tests, the best resource i found in this topic is <a title="The RSpec Book" href="http://pragprog.com/book/achbd/the-rspec-book" target="_blank">The RSpec Book</a> from Pragmatic Programmers.</li>
</ol>
<h2>Tools</h2>
<p>You can using only the command line a text editor to build awesome rails apps (In fact I found it is the best way)</p>
<ul>
<li>For Windows you can use <a title="e-texteditor" href="http://www.e-texteditor.com/" target="_blank">e-texteditor</a></li>
<li>For Mac <a title="TextMate" href="http://macromates.com/" target="_blank">TextMate</a> is your best friend</li>
<li>VI is my editor of choice but if you are new to linux <a title="Redcar" href="http://redcareditor.com/" target="_blank">Redcar</a> can provide a good graphical interface editor</li>
</ul>
<p>If you are the IDE type of person <a title="Aptana" href="http://aptana.com/" target="_blank">Aptana</a> is a great IDE with wonderful support for Rails</p>
<h2>Additional Resources</h2>
<ul>
<li> <a title="Rails Casts" href="http://railscasts.com/" target="_blank">RailsCasts</a>: Wonderful weekly screen casts each about 15 min discussing a new gem in rails, and if you like it in text you can visit <a title="AsciiCasts" href="http://www.asciicasts.com/" target="_blank">AsciiCasts</a> for transcription</li>
<li><a title="Rails Recipes" href="http://pragprog.com/book/rr2/rails-recipes" target="_blank">Rails Recipes</a>: Packaged solutions for common rails problems</li>
<li><a title="Crafting Rails Applications" href="http://pragprog.com/book/jvrails/crafting-rails-applications" target="_blank">Crafting Rails Applications</a>: gives you a better understanding how Rails working and how to customize it</li>
<li><a title="Programming Ruby 1.9" href="http://pragprog.com/book/ruby3/programming-ruby-1-9" target="_blank">Programming Ruby 1.9</a>: The most famous book written for Ruby language (also called PickAxe referring to the image on the cover)</li>
<li><a title="Agile Web Development with Rails" href="http://pragprog.com/book/rails4/agile-web-development-with-rails" target="_blank">Agile Web Development with Rails</a>: The Rails bible co-authored by DHH the master mind behind RoR</li>
<li><a title="Rails Tutorial" href="http://ruby.railstutorial.org/" target="_blank">Rails Tutorial by Michael Hartl</a></li>
<li>Pragmatic Programmers has some awesome books on <a title="Books" href="http://pragprog.com/categories/ruby_and_rails" target="_blank">Ruby and Rails</a></li>
<li><a title="Google" href="http://www.google.com" target="_blank">Google</a>: He will always be your friend <img src='http://www.josephwahba.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>Happy Coding</p>
]]></content:encoded>
			<wfw:commentRss>http://www.josephwahba.com/2011/12/pragmatic-approach-to-learn-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

