<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Celavi | blog</title>
	
	<link>http://www.celavi.org</link>
	<description>The Weblog of Ales Loncar</description>
	<lastBuildDate>Tue, 25 Oct 2011 19:47:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/celavi" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="celavi" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Free PrestaShop Column Block Module: Facebook Like Box</title>
		<link>http://www.celavi.org/2010/09/19/free-prestashop-column-block-module-facebook-like-box/</link>
		<comments>http://www.celavi.org/2010/09/19/free-prestashop-column-block-module-facebook-like-box/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 21:28:56 +0000</pubDate>
		<dc:creator>Celavi</dc:creator>
				<category><![CDATA[Free PrestaShop Modules]]></category>
		<category><![CDATA[Column Block Module]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PrestaShop]]></category>

		<guid isPermaLink="false">http://www.celavi.org/?p=408</guid>
		<description><![CDATA[I&#8217;ve recently finished one of my projects and successfully published it on web. It&#8217;s based on an open source e-commerce solution PrestaShop. Why did I choose PrestaShop? Largely because of the simplicity and functionality. Store has a modern look and follows MVC architecture, which makes easy and rapid development. New themes and modules are added]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.celavi.org/wp-content/uploads/2010/09/shop.fit-body.si-2010-9-19-21-31.png" rel="lightbox[408]"><img class="alignleft size-medium wp-image-416" title="PrestaShop Column Block Module: Facebook Like Box" src="http://www.celavi.org/wp-content/uploads/2010/09/shop.fit-body.si-2010-9-19-21-31-300x225.png" alt="PrestaShop Column Block Module: Facebook Like Box" width="300" height="225" /></a>I&#8217;ve recently finished one of my projects and successfully published it on <a href="http://shop.fit-body.si/">web</a>. It&#8217;s based on an <a class="zem_slink" title="Open source" rel="wikipedia" href="http://en.wikipedia.org/wiki/Open_source">open source</a> <a class="zem_slink" title="Electronic commerce" rel="wikipedia" href="http://en.wikipedia.org/wiki/Electronic_commerce">e-commerce</a> solution <strong><a class="zem_slink" title="PrestaShop" rel="homepage" href="http://www.prestashop.com">PrestaShop</a></strong>.</p>
<h4>Why did I choose PrestaShop?</h4>
<p>Largely because of the simplicity and functionality. Store has a modern look and follows <a class="zem_slink" title="Model–view–controller" rel="wikipedia" href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">MVC architecture</a>, which makes easy and <a class="zem_slink" title="Rapid application development" rel="wikipedia" href="http://en.wikipedia.org/wiki/Rapid_application_development">rapid development</a>. New themes and modules are added via administrator interface. You can find few templates and modules on the net for free, but for most of them you have to pay. PrestaShop is definitely a very big part of the future of e-commerce!</p>
<p>I wanted to add <a href="http://developers.facebook.com/docs/reference/plugins/like-box/">Facebook Like Box </a>plug-in to be shown at e-shop, but there aren&#8217;t any <a class="zem_slink" title="Free module" rel="wikipedia" href="http://en.wikipedia.org/wiki/Free_module">free modules</a> available<sup><a href="http://www.celavi.org/2010/09/19/free-prestashop-column-block-module-facebook-like-box/#footnote_0_408" id="identifier_0_408" class="footnote-link footnote-identifier-link" title="at least I couldn&amp;#8217;t find it">1</a></sup>. If you don&#8217;t know how to code in <a class="zem_slink" title="PHP" rel="homepage" href="http://www.php.net/">PHP</a> / <a class="zem_slink" title="HTML" rel="wikipedia" href="http://en.wikipedia.org/wiki/HTML">HTML</a> / <a class="zem_slink" title="Smarty" rel="homepage" href="http://www.smarty.net/">Smarty</a> the only option what is left is buyin the module on<a href="http://addons.prestashop.com/en/search.php?id_category_search=0&amp;search_query=facebook"> PrestaShop</a><sup><a href="http://www.celavi.org/2010/09/19/free-prestashop-column-block-module-facebook-like-box/#footnote_1_408" id="identifier_1_408" class="footnote-link footnote-identifier-link" title="30 / 40 EUR">2</a></sup>. I didn&#8217;t want yo pay 40 EUR for a very <a class="zem_slink" title="Simple module" rel="wikipedia" href="http://en.wikipedia.org/wiki/Simple_module">simple module</a>, so I&#8217;ve decided to write it myself. Module is written for the PrestaShop version <strong>1.3.1</strong></p>
<p>If you don&#8217;t have the latest version of PrestaShop open blockfblikebox.php file in directory modules/blockfblikebox and delete this two lines:</p>
<pre class="brush: php;">
if (!defined('_CAN_LOAD_FILES_'))
    exit;
</pre>
<p>I&#8217;ve also made a video which demonstrates how to install Facebook Like Box plugin to your PrestaShop page.<br />
<p><a href="http://www.celavi.org/2010/09/19/free-prestashop-column-block-module-facebook-like-box/"><em>Click here to view the embedded video.</em></a></p></p>
<p>Facebook Like Box <span class="zem_slink">plugin</span> for Prestashop free download:<br />
Note: There is a file embedded within this post, please visit this post to download the file.</p>
<p>And remember, contributions earn you karma ;)</p>
<h6 class="zemanta-related-title">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://thesocialmediaguide.com.au/2010/09/03/how-to-add-a-facebook-like-box-button-to-your-website/">How to Add a Facebook Like Box to your Website</a> (thesocialmediaguide.com.au)</li>
<li class="zemanta-article-ul-li"><a href="http://socio-nerd.blogspot.com/2010/09/install-facebook-like-box-to-your-blog.html">Install Facebook LIKE BOX to Your Blog</a> (socio-nerd.blogspot.com)</li>
<li class="zemanta-article-ul-li"><a href="http://books.slashdot.org/story/10/08/25/1245213/PrestaShop-13-Beginners-Guide">PrestaShop 1.3 Beginner&#8217;s Guide</a> (books.slashdot.org)</li>
</ul>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=eab41286-519d-42a8-9def-4c187293c848" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<ol class="footnotes"><li id="footnote_0_408" class="footnote">at least I couldn&#8217;t find it</li><li id="footnote_1_408" class="footnote">30 / 40 EUR</li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.celavi.org/2010/09/19/free-prestashop-column-block-module-facebook-like-box/feed/</wfw:commentRss>
		<slash:comments>57</slash:comments>
		</item>
		<item>
		<title>Packt’s new book on Nginx: Nginx HTTP Server</title>
		<link>http://www.celavi.org/2010/08/16/packts-new-book-on-nginx-nginx-http-server/</link>
		<comments>http://www.celavi.org/2010/08/16/packts-new-book-on-nginx-nginx-http-server/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 09:33:51 +0000</pubDate>
		<dc:creator>Celavi</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[FastCGI]]></category>
		<category><![CDATA[Packt]]></category>
		<category><![CDATA[Web server]]></category>

		<guid isPermaLink="false">http://www.celavi.org/?p=390</guid>
		<description><![CDATA[Well, as you can tell, it’s been about a month since I’ve posted on this blog, but I’ve been busy1 elsewhere. In a week or two I&#8217;d share with you a few of the projects I&#8217;ve been working on recently and show you some peeks at what I will be doing for this Autumn and]]></description>
			<content:encoded><![CDATA[<p>Well, as you can tell, it’s been about a month since I’ve posted on this blog, but I’ve been busy<sup><a href="http://www.celavi.org/2010/08/16/packts-new-book-on-nginx-nginx-http-server/#footnote_0_390" id="identifier_0_390" class="footnote-link footnote-identifier-link" title="as usual">1</a></sup> elsewhere. In a week or two I&#8217;d share with you a few of the projects I&#8217;ve been working on recently and show you some peeks at what I will be doing for this Autumn and beyond.</p>
<p><strong>What else is new?</strong><br />
I was approached about two weeks ago by <a href="https://www.packtpub.com/">Packt Publishing</a> to write a review of a new book on <a class="zem_slink" title="Nginx" rel="homepage" href="http://www.nginx.org">Nginx</a>. I&#8217;ve never done it before, but it will be a new challenge for me. I&#8217;ll publish my review on <a href="http://www.celavi.org/">Celavi|Blog</a> so you should check back from time to time :) They found me by <a class="zem_slink" title="Google" rel="homepage" href="http://google.com">Google</a> Search. Especially they noticed valuable and informative post about setting up <a href="http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/">Nginx</a> on <a class="zem_slink" title="Ubuntu (operating system)" rel="homepage" href="http://www.ubuntu.com/">Ubuntu</a>. I have to say, it sure does make all the time spent blogging feel a little more worthwhile!</p>
<h3>Nginx HTTP Server</h3>
<p><a href="http://www.packtpub.com/nginx-http-server-for-web-applications/book?utm_source=celavi.org&amp;utm_medium=link&amp;utm_content=blog&amp;utm_campaign=mdb_004154"><img class="alignleft size-medium wp-image-392" title="Nginx HTTP Server" src="http://www.celavi.org/wp-content/uploads/2010/08/Nginx-HTTP-Server-243x300.jpg" alt="Nginx HTTP Server" width="243" height="300" /></a><strong>Nginx HTTP Server</strong> is a new book from Packt, written by <strong>Clement Nedelcu</strong>. This book is a detailed guide to setting up Nginx in different production situations: as standalone server, as <a class="zem_slink" title="Reverse proxy" rel="wikipedia" href="http://en.wikipedia.org/wiki/Reverse_proxy">reverse proxy</a>, interacting with applications via <a class="zem_slink" title="FastCGI" rel="wikipedia" href="http://en.wikipedia.org/wiki/FastCGI">FastCGI</a>, and more. Using this book readers will be able to explore possible interactions between Nginx and <a class="zem_slink" title="Apache HTTP Server" rel="homepage" href="http://httpd.apache.org/">Apache</a> to get the best of both worlds.<br />
Using this book, readers will be able to download and build Nginx from source along with its dependencies. In addition to this, they will learn the basics of Nginx configuration, process of replacing Apache by Nginx and troubleshooting. Users will also be able to configure Nginx to work as frontend for their existing <a class="zem_slink" title="Web server" rel="wikipedia" href="http://en.wikipedia.org/wiki/Web_server">HTTP server</a> and establish advanced rewrite rules with the Nginx Rewrite module.<br />
To read more about the book, please visit <a href="http://www.packtpub.com/nginx-http-server-for-web-applications/book?utm_source=celavi.org&amp;utm_medium=link&amp;utm_content=blog&amp;utm_campaign=mdb_004154">Packt Publishing Technical &amp; IT Book Store</a>.</p>
<h6 class="zemanta-related-title">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://matthewhelmke.net/2010/08/14/nginx-http-server/">Matthew Helmke: Nginx HTTP Server</a> (matthewhelmke.net)</li>
</ul>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=d411341c-6397-4734-8d2e-465ab3003f18" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<ol class="footnotes"><li id="footnote_0_390" class="footnote">as usual</li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.celavi.org/2010/08/16/packts-new-book-on-nginx-nginx-http-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KjeSeRoka v0.4.1 released</title>
		<link>http://www.celavi.org/2010/06/30/kjeseroka-v0-4-1-released/</link>
		<comments>http://www.celavi.org/2010/06/30/kjeseroka-v0-4-1-released/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 12:32:06 +0000</pubDate>
		<dc:creator>Celavi</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[KjeSeRoka]]></category>
		<category><![CDATA[Android (operating system)]]></category>
		<category><![CDATA[AndroidMarket]]></category>
		<category><![CDATA[Free]]></category>
		<category><![CDATA[Handhelds]]></category>

		<guid isPermaLink="false">http://www.celavi.org/?p=374</guid>
		<description><![CDATA[KjeSeRoka version 0.4.1 is now available for download on Android Market. Users can now see a daily list of concerts when pressing the button &#8220;Kam danes?&#8221; Download Related articles by Zemanta How to Backup Android Home Screens (brighthub.com) Amazon punts Kindleware for Androids (go.theregister.com)]]></description>
			<content:encoded><![CDATA[<p>KjeSeRoka version 0.4.1 is now available for download on <a class="zem_slink" title="Android Market" rel="homepage" href="http://www.android.com/market/">Android Market</a>. Users can now see a daily list of concerts when pressing the button &#8220;Kam danes?&#8221;</p>
<p><a href="/kjeseroka/"><strong>Download</strong></a></p>

<a href='http://www.celavi.org/2010/06/30/kjeseroka-v0-4-1-released/kam_danes_1/' title='KjeSeRoka - &quot;Kam danes?&quot; button now implemented'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/kam_danes_1-150x150.png" class="attachment-thumbnail" alt="KjeSeRoka - &quot;Kam danes?&quot; button now implemented" title="KjeSeRoka - &quot;Kam danes?&quot; button now implemented" /></a>
<a href='http://www.celavi.org/2010/06/30/kjeseroka-v0-4-1-released/kam_danes_2/' title='KjeSeRoka - a daily list of concerts'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/kam_danes_2-150x150.png" class="attachment-thumbnail" alt="KjeSeRoka - a daily list of concerts" title="KjeSeRoka - a daily list of concerts" /></a>

<h6 class="zemanta-related-title">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.brighthub.com/mobile/htc/articles/75976.aspx">How to Backup Android Home Screens</a> (brighthub.com)</li>
<li class="zemanta-article-ul-li"><a href="http://go.theregister.com/feed/www.theregister.co.uk/2010/06/29/kindle_for_android/">Amazon punts Kindleware for Androids</a> (go.theregister.com)</li>
</ul>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=712d5fa3-4dc2-47e9-b084-eea373cce57c" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.celavi.org/2010/06/30/kjeseroka-v0-4-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install Nginx with PHP5 (FastCGI) and MySQL support on Ubuntu 10.4 LTS</title>
		<link>http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/</link>
		<comments>http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 15:33:11 +0000</pubDate>
		<dc:creator>Celavi</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu / Linux]]></category>
		<category><![CDATA[FastCGI]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[spawn-fcgi]]></category>
		<category><![CDATA[Web server]]></category>

		<guid isPermaLink="false">http://www.celavi.org/?p=215</guid>
		<description><![CDATA[I won&#8217;t give you a lecture about using Nginx for a perfect web server. But the fact is that Apache is mostly a memory hog, so we are sometimes forced to look for alternative ways to host our websites. I will show you a step to step guide to install all the necessary software to]]></description>
			<content:encoded><![CDATA[<p>I won&#8217;t give you a lecture about using <a class="zem_slink" title="Nginx" rel="homepage" href="http://www.nginx.org">Nginx</a> for a perfect <a class="zem_slink" title="Web server" rel="wikipedia" href="http://en.wikipedia.org/wiki/Web_server">web server</a>. But the fact is that <a class="zem_slink" title="Apache HTTP Server" rel="homepage" href="http://httpd.apache.org/">Apache</a> is mostly a memory hog, so we are sometimes forced to look for alternative ways to host our websites. I will show you a step to step guide to install all the necessary <a class="zem_slink" title="Computer software" rel="wikipedia" href="http://en.wikipedia.org/wiki/Computer_software">software</a> to run any sort of <a class="zem_slink" title="PHP" rel="homepage" href="http://www.php.net/">PHP</a> application on your local machine.  Read on to see how that can be achieved…</p>
<p><strong>First step</strong> is updating your <strong><a class="zem_slink" title="Ubuntu (operating system)" rel="homepage" href="http://www.ubuntu.com/">Ubuntu</a></strong> Installation</p>
<pre class="brush: bash;">
sudo aptitude update
sudo aptitude safe-upgrade
</pre>
<p>This will update the apt package database and install all the latest updates (if there are any). If you see that a new kernel gets installed as part of the updates, you should reboot the system afterwards.</p>
<p><strong>Installing Nginx</strong> is the <strong>next step</strong>. This can be easily done by following the next step (assuming there is no other web server up and running). Everything will be installed by default.</p>
<pre class="brush: bash;">
sudo aptitude install nginx
</pre>
<p>Start nginx afterwards:</p>
<pre class="brush: bash;">
sudo /etc/init.d/nginx start
</pre>
<p>After typing your web server&#8217;s hostname into a browser<sup><a href="http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/#footnote_0_215" id="identifier_0_215" class="footnote-link footnote-identifier-link" title="http://localhost">1</a></sup>, you should see the Nginx welcome page.</p>
<p>To make Nginx start at boot time, run</p>
<pre class="brush: bash;">
sudo update-rc.d nginx defaults
</pre>
<p><strong>Next,</strong> we need <strong><a class="zem_slink" title="FastCGI" rel="wikipedia" href="http://en.wikipedia.org/wiki/FastCGI">FastCGI</a></strong> deamon to run PHP5 in fcgi mode. First off, Nginx doesn&#8217;t have its own internal FastCGI process manager, so we must run the FastCGI service separately. Usually the preferred method was to use spawn-fcgi program provided by the <a class="zem_slink" title="Lighttpd" rel="homepage" href="http://www.lighttpd.net">lighttpd</a> web server. That&#8217;s not necessary any more, because from version 1.6.0 ahead spawn-fcgi was separated from lighttpd project.  To install spawn-fcgi, run the following command.</p>
<pre class="brush: bash;">
sudo aptitude install spawn-fcgi
</pre>
<p>For now, we&#8217;re going to leave everything as it is and we&#8217;ll move forward with installing <a class="zem_slink" title="MySQL" rel="homepage" href="http://www.mysql.com">MySQL</a> and PHP5.</p>
<p>Let&#8217;s install <strong>MySQL</strong> server and client binaries. The process is quick and easy.</p>
<pre class="brush: bash;">
sudo aptitude install mysql-server mysql-client
</pre>
<p>You will be asked to provide a password for the MySQL root user. After we specify a MySQL root password, the installation will finish. We can try the MySQL client program via command line tool:</p>
<pre class="brush: bash;">
mysql -u root -p
</pre>
<p>Installing <strong>PHP5</strong>. Now it&#8217;s time to install PHP5 via FastCGI. Ubuntu provides a FastCGI-enabled PHP5 package. We&#8217;ll install only core packages and add others when needed.</p>
<pre class="brush: bash;">
sudo aptitude install php5 php5-cli php5-common php5-suhosin php5-cgi php-pear php5-mysql
</pre>
<p>We&#8217;ve installed everything for running PHP on our computer, so let&#8217;s move on to necessary configuration. First, let&#8217;s write a script which will spawn FastCGI PHP processes on a unix domain socket, so there is no need for tcp/ip on localhost. Let&#8217;s create file /usr/sbin/fastcgi-php</p>
<pre class="brush: bash;">
sudo touch /usr/sbin/fastcgi-php
</pre>
<pre class="brush: bash;">
#!/bin/sh
FCGIPHP_BIN_PATH=&quot;/usr/bin/php5-cgi&quot;
FCGIPHP_USER=&quot;www-data&quot;
FCGIPHP_GROUP=&quot;www-data&quot;
FCGIPHP_CHILDREN=&quot;2&quot;
FCGIPHP_MAX_REQUEST=&quot;1000&quot;
FCGIPHP_SERVER_ADDR=&quot;127.0.0.1&quot;
FCGIPHP_SOCKET=&quot;/tmp/php-fastcgi.sock&quot;
PIDFILE=&quot;/var/run/php5-fcgi.pid&quot;
SPAWN_FCGI=&quot;/usr/bin/spawn-fcgi&quot;
FCGIPHP_ENV=&quot;SHELL PATH USER&quot;

COMMAND_ARGS=&quot;$SPAWN_FCGI -C $FCGIPHP_CHILDREN -s $FCGIPHP_SOCKET -f $FCGIPHP_BIN_PATH -u $FCGIPHP_USER -g $FCGIPHP_GROUP  -P $PIDFILE&quot;

export FCGIPHP_MAX_REQUEST
export FCGIPHP_SERVER_ADDR
ALLOWED_ENV=&quot;$FCGIPHP_ENV FCGIPHP_MAX_REQUEST FCGIPHP_SERVER_ADDR&quot;
E=&quot;&quot;
for i in $ALLOWED_ENV; do
	eval &quot;x=\$$i&quot;
	E=&quot;$E $i=$x&quot;
done

start(){
	echo &quot;STARTING PHP-FCGI&quot;
	if [ -f $PIDFILE ];then
        echo &quot;PHP-FCGI is running already.&quot;;
        exit 1;
    fi
	echo $COMMAND_ARGS
	env - $E $COMMAND_ARGS
}
stop(){
	echo &quot;STOPING PHP-FCGI&quot;
	if test -f $PIDFILE;then
        killall `basename $FCGIPHP_BIN_PATH`
        rm -f $PIDFILE
    else
        echo &quot;PHP-FCGI is not running&quot;
    fi
}

#Main################
case &quot;$1&quot; in
    'start')
    start
    ;;
    'stop')
    stop
    ;;
    'restart')
    stop
    start
    ;;
    *)
    echo &quot;usage: $0 {start|stop|restart}&quot;
    ;;
esac
exit 1
</pre>
<p>and give it execute permissions. After that let&#8217;s start the process.</p>
<pre class="brush: bash;">
sudo chmod a+x /usr/sbin/fastcgi-php
sudo /usr/sbin/fastcgi-php start
</pre>
<p><strong>Final step</strong>, <strong>Nginx configuration</strong>. To get the web server up and running properly, we need to edit the file /etc/nginx/nginx.conf. We&#8217;ll pass all PHP calls to an upstream server called php5 so edit your configuration file to look like this:</p>
<pre class="brush: bash;">
http {
	include /etc/nginx/mime.types;

	access_log /var/log/nginx/access.log;

	sendfile 			on;
	keepalive_timeout 	65;
	tcp_nodelay 		on;

	gzip on;
	gzip_disable &quot;MSIE [1-6]\.(?!.*SV1)&quot;;

	upstream php5 {
		server    unix:/tmp/php-fastcgi.sock;
	}

	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}
</pre>
<p>Any further configuration files needed for our applications will be located in /etc/nginx/sites-available and linked to /etc/nginx/sites-enabled. Let&#8217;s add new site which will link to our home public folder ~/Public and we will call it <strong>my.public.local</strong>. Now create my.public.local.conf in /etc/nginx/sites-available</p>
<pre class="brush: bash;">
server {
	listen       80;
	reset_timedout_connection on;

	server_name my.public.local;
	root /home/celavi/Public;
	client_max_body_size 500m;
	autoindex on;

	location / {
		index  index.php;
	}

	# Handle Static Content Here
	location ~* ^.+\.(jpg|jpeg|gif|png|ico)$  {
		access_log off;
		gzip off;
		expires 30d;
	}

	location ~* ^.+\.(css|js)$ {
		access_log off;
		expires 1d;
	}

	location ~* ^.+\.(pdf|gz|bz2|exe|rar|zip|7z)$ {
		gzip off;
	}

	location ~ \.php$ {
		include        /etc/nginx/fastcgi_params;
		fastcgi_pass   php5;
		fastcgi_index  index.php;
		fastcgi_param  SCRIPT_FILENAME  $document_root/$fastcgi_script_name;
	}
}
</pre>
<p>and create a symbolic link to /etc/nginx/sites-enabled</p>
<pre class="brush: bash;">
sudo ln -s /etc/nginx/sites-availible/my.public.local.conf /etc/nginx/sites-enabled/my.public.local.conf
</pre>
<p>We need to tell the operating system to map <strong>my.public.local</strong> to local IP address. Open file <a class="zem_slink" title="Hosts file" rel="wikipedia" href="http://en.wikipedia.org/wiki/Hosts_file">/etc/hosts</a> and add this line:</p>
<pre class="brush: bash;">
#local maping
127.0.0.1       my.public.local
</pre>
<p>Let&#8217;s restart Nginx</p>
<pre class="brush: bash;">
sudo /etc/init.d/nginx restart
</pre>
<p>In order to test if the execution of PHP is working, create an index.php file in ~/Public folder with the following content:</p>
<pre class="brush: php;">
&lt;?php
echo phpinfo();
</pre>
<p>Open browser and type http://my.public.local. If  you did not see the phpinfo, there might be something wrong. In order to track down what went wrong, you can check the Nginx error log:</p>
<pre class="brush: bash;">
sudo tail /var/log/nginx/error.log
</pre>
<p>Remember, if you did change your php.ini you have to restart /usr/sbin/fastcgi-php. Restarting nginx isn&#8217;t&#8217; necessary.</p>
<p>Well, that&#8217;s it. Now you can start developing your PHP apps.</p>
<p>Screenshots:<br />

<a href='http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/screen-shot-2010-05-19-at-12-42-43-am/' title='Ubuntu after latest updates'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/Screen-shot-2010-05-19-at-12.42.43-AM-150x150.png" class="attachment-thumbnail" alt="Ubuntu after latest updates" title="Ubuntu after latest updates" /></a>
<a href='http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/screen-shot-2010-05-19-at-12-48-59-am/' title='Nginx welcome screen'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/Screen-shot-2010-05-19-at-12.48.59-AM-150x150.png" class="attachment-thumbnail" alt="Nginx welcome screen" title="Nginx welcome screen" /></a>
<a href='http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/nginx_03/' title='Install MySQL server and client binaries'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/nginx_03-150x150.png" class="attachment-thumbnail" alt="Install MySQL server and client binaries" title="Install MySQL server and client binaries" /></a>
<a href='http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/nginx_04/' title='Provide a password for the MySQL root user'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/nginx_04-150x150.png" class="attachment-thumbnail" alt="Provide a password for the MySQL root user" title="Provide a password for the MySQL root user" /></a>
<a href='http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/nginx_05/' title='Run the MySQL client program via command line tool'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/nginx_05-150x150.png" class="attachment-thumbnail" alt="Run the MySQL client program via command line tool" title="Run the MySQL client program via command line tool" /></a>
<a href='http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/nginx_06/' title=' Install PHP5'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/nginx_06-150x150.png" class="attachment-thumbnail" alt="Install PHP5" title="Install PHP5" /></a>
<a href='http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/nginx_07/' title='FastCGI PHP processes script'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/nginx_07-150x150.png" class="attachment-thumbnail" alt="FastCGI PHP processes script" title="FastCGI PHP processes script" /></a>
<a href='http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/nginx_08/' title='Starting PHP-FCGI'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/nginx_08-150x150.png" class="attachment-thumbnail" alt="Starting PHP-FCGI" title="Starting PHP-FCGI" /></a>
<a href='http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/nginx_09/' title='Content of /etc/nginx/nginx.conf'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/nginx_09-150x150.png" class="attachment-thumbnail" alt="Content of /etc/nginx/nginx.conf" title="Content of /etc/nginx/nginx.conf" /></a>
<a href='http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/nginx_10/' title='Nginx configuration file for my.public.local'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/nginx_10-150x150.png" class="attachment-thumbnail" alt="Nginx configuration file for my.public.local" title="Nginx configuration file for my.public.local" /></a>
<a href='http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/nginx_11/' title='Content of /etc/hosts'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/nginx_11-150x150.png" class="attachment-thumbnail" alt="Content of /etc/hosts" title="Content of /etc/hosts" /></a>
<a href='http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/nginx_12/' title='After Nginx restarts'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/nginx_12-150x150.png" class="attachment-thumbnail" alt="After Nginx restarts" title="After Nginx restarts" /></a>
<a href='http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/nginx_13/' title='PHPinfo returned information about the current state of PHP'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/nginx_13-150x150.png" class="attachment-thumbnail" alt="PHPinfo returned information about the current state of PHP" title="PHPinfo returned information about the current state of PHP" /></a>
</p>
<p>And remember, contributions earn you karma. ;)</p>
<h6 class="zemanta-related-title">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://matthewhelmke.net/2010/05/19/nginx-php-fastcgi-and-ubuntu-10-04/">Matthew Helmke: nginx, php-fastcgi and Ubuntu 10.04</a> (matthewhelmke.net)</li>
<li class="zemanta-article-ul-li"><a href="http://simplechatter.com/2010/06/nginx-is-extremely-performant/">Nginx is extremely performant</a> (simplechatter.com)</li>
<li class="zemanta-article-ul-li"><a href="http://interfacelab.com/nginx-php-fpm-apc-awesome/">NGINX + PHP-FPM + APC = Awesome</a> (interfacelab.com)</li>
</ul>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=17294de0-0d90-45e2-83c4-b627ac544a69" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<ol class="footnotes"><li id="footnote_0_215" class="footnote">http://localhost</li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.celavi.org/2010/06/26/how-to-install-nginx-with-php5-fastcgi-and-mysql-support-on-ubuntu-10-4-lts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>KjeSeRoka means “Where’s your arm?” or what?</title>
		<link>http://www.celavi.org/2010/06/22/kjeseroka-means-wheres-your-arm-or-what/</link>
		<comments>http://www.celavi.org/2010/06/22/kjeseroka-means-wheres-your-arm-or-what/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 11:38:48 +0000</pubDate>
		<dc:creator>Celavi</dc:creator>
				<category><![CDATA[KjeSeRoka]]></category>
		<category><![CDATA[Edo Maajka]]></category>
		<category><![CDATA[Frenkie]]></category>
		<category><![CDATA[rokaj]]></category>
		<category><![CDATA[rokat]]></category>

		<guid isPermaLink="false">http://www.celavi.org/?p=295</guid>
		<description><![CDATA[I&#8217;ve received several emails and comments about KjeSeRoka and what the appropriate translation would be in English. I will try to explain it&#8217;s meaning for those whose first language is not Slovene. The most appropriate translation1 would be: &#8220;Where&#8217;s The Party?&#8221;, or in this particular case &#8220;Where I can find upcoming rock concerts in Slovenia?&#8221;.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve received several emails and comments about <a href="/kjeseroka/">KjeSeRoka</a> and what the appropriate translation would be in <a title="English language" rel="wikipedia" href="http://en.wikipedia.org/wiki/English_language">English</a>. I will try to explain it&#8217;s meaning for those whose first language is not <a class="zem_slink" title="Slovene language" rel="wikipedia" href="http://en.wikipedia.org/wiki/Slovene_language">Slovene</a>.</p>
<p>The most appropriate translation<sup><a href="http://www.celavi.org/2010/06/22/kjeseroka-means-wheres-your-arm-or-what/#footnote_0_295" id="identifier_0_295" class="footnote-link footnote-identifier-link" title="more interpretation">1</a></sup> would be: &#8220;Where&#8217;s The Party?&#8221;, or in this particular case &#8220;Where I can find upcoming <a class="zem_slink" title="Rock music" rel="wikipedia" href="http://en.wikipedia.org/wiki/Rock_music">rock</a> concerts in Slovenia?&#8221;.</p>
<p><strong>Rokat / rokaj</strong></p>
<p>Word rokat/rokaj has common origin in <a class="zem_slink" title="South Slavic languages" rel="wikipedia" href="http://en.wikipedia.org/wiki/South_Slavic_languages">South Slavic languages</a> (<a class="zem_slink" title="Serbian language" rel="wikipedia" href="http://en.wikipedia.org/wiki/Serbian_language">Serbian</a>, <a class="zem_slink" title="Croatian language" rel="wikipedia" href="http://en.wikipedia.org/wiki/Croatian_language">Croatian</a>, <a class="zem_slink" title="Bosnian language" rel="wikipedia" href="http://en.wikipedia.org/wiki/Bosnian_language">Bosnian</a>) and can have a lot of different meanings.</p>
<p>Let&#8217;s look at these examples:</p>
<ul>
<li>Reprezentacija Portugala totalno je <strong>srokala</strong> Sjevernu Koreju sa 7:0 = Portugal&#8217;s team has totally crushed North Korea with 7:0</li>
<li>Ajmo <strong>rokat</strong>! = Let&#8217;s get the party started =  Let&#8217;s Rock! ©Duke Nukem</li>
<li>Glazbenici, definicija vaše muzike, šta je to što <strong>rokate</strong>? = Musicians, the definition of your music, what is it that you play?</li>
<li>Oko njega su <strong>rokale</strong> granate a mitraljez koji je cijepao po polju držao ga je zakovanim za zemlju. = While the gradates were falling all around him, the machine gun was keeping him low to the ground.</li>
<li><a class="zem_slink" title="Frenkie" rel="lastfm" href="http://www.last.fm/music/Frenkie">Frenkie</a> feat. Baby Dooks &#8211; Bruce Lee Rap &#8211; &#8230; Frenkie će <strong>rokat</strong> i dalje jer ta ti mašina ne staje &#8230; = Frenkie will always rule, because this machine does not stop &#8230;<br />
<p><a href="http://www.celavi.org/2010/06/22/kjeseroka-means-wheres-your-arm-or-what/"><em>Click here to view the embedded video.</em></a></p></li>
<li><a class="zem_slink" title="Edo Maajka" rel="homepage" href="http://www.edomaajka.com">Edo Maajka</a> &#8211; Pare, pare &#8230; Edo i Dash, pare, pare, keš, bolje od nas <strong>rokat</strong>` nikad nemožeš &#8230; = Edo and Dash, money, money, cash, you can&#8217;t ever rock better than us &#8230;<br />
<p><a href="http://www.celavi.org/2010/06/22/kjeseroka-means-wheres-your-arm-or-what/"><em>Click here to view the embedded video.</em></a></p></li>
</ul>
<p>I hope these examples where enough illustrated. :D</p>
<p>And remember, contributions earn you karma. ;)</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=a2b0a31f-fa24-450d-a032-cb1a297e8e91" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<ol class="footnotes"><li id="footnote_0_295" class="footnote">more interpretation</li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.celavi.org/2010/06/22/kjeseroka-means-wheres-your-arm-or-what/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KjeSeRoka v0.3.9 released</title>
		<link>http://www.celavi.org/2010/06/20/kjeseroka-v0-3-9-released/</link>
		<comments>http://www.celavi.org/2010/06/20/kjeseroka-v0-3-9-released/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 23:01:32 +0000</pubDate>
		<dc:creator>Celavi</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[KjeSeRoka]]></category>
		<category><![CDATA[Android (operating system)]]></category>

		<guid isPermaLink="false">http://www.celavi.org/?p=273</guid>
		<description><![CDATA[I just pushed the new version 0.3.9 release that allows you to send email directly to venue. I am currently working on implementing a feature that will display a list of today&#8217;s events. Download Screenshots]]></description>
			<content:encoded><![CDATA[<p>I just pushed the new version 0.3.9 release that allows you to send email directly to venue. I am currently working on implementing a feature that will display a list of today&#8217;s events.</p>
<p><strong><a href="/kjeseroka/">Download</a></strong></p>
<p><strong>Screenshots</strong><br />

<a href='http://www.celavi.org/2010/06/20/kjeseroka-v0-3-9-released/send_mail_01/' title='KjeSeRoka - send mail directly to Venue'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/send_mail_01-150x150.png" class="attachment-thumbnail" alt="KjeSeRoka - send mail directly to Venue" title="KjeSeRoka - send mail directly to Venue" /></a>
<a href='http://www.celavi.org/2010/06/20/kjeseroka-v0-3-9-released/send_mail_02/' title='KjeSeRoka - composing email'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/send_mail_02-150x150.png" class="attachment-thumbnail" alt="KjeSeRoka - composing email" title="KjeSeRoka - composing email" /></a>
<a href='http://www.celavi.org/2010/06/20/kjeseroka-v0-3-9-released/send_mail_03_a/' title='KjeSeRoka - Sending with default mail application'><img width="150" height="150" src="http://www.celavi.org/wp-content/uploads/2010/06/send_mail_03_a-150x150.png" class="attachment-thumbnail" alt="KjeSeRoka - Sending with default mail application" title="KjeSeRoka - Sending with default mail application" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.celavi.org/2010/06/20/kjeseroka-v0-3-9-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How I taught myself Android Application Development</title>
		<link>http://www.celavi.org/2010/06/19/how-i-taught-myself-android-application-development/</link>
		<comments>http://www.celavi.org/2010/06/19/how-i-taught-myself-android-application-development/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 13:16:46 +0000</pubDate>
		<dc:creator>Celavi</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Android (operating system)]]></category>
		<category><![CDATA[Computer programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.celavi.org/?p=252</guid>
		<description><![CDATA[I&#8217;ve learned every programming language that I&#8217;ve used during my career reusing concepts I already knew and referring to documentation and books to learn its syntax. It&#8217;s been a while since I&#8217;ve learned my last one. I&#8217;m pretty sure that everybody heard the now classic advice from the Pragmatic Programmer: &#8220;Learn at least one new]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.celavi.org/wp-content/uploads/2010/06/hireme.png" rel="lightbox[252]"><img class="alignleft size-thumbnail wp-image-257" title="Hire Me" src="http://www.celavi.org/wp-content/uploads/2010/06/hireme-150x150.png" alt="Hire Me" width="150" height="150" /></a>I&#8217;ve learned every <a class="zem_slink" title="Programming language" rel="wikipedia" href="http://en.wikipedia.org/wiki/Programming_language">programming language</a> that I&#8217;ve used during my career reusing concepts I already knew and referring to documentation and books to learn its syntax. It&#8217;s been a while since I&#8217;ve learned my last one. I&#8217;m pretty sure that everybody heard the now classic advice from the Pragmatic Programmer: &#8220;<strong>Learn at least one new programming language a year!</strong>&#8221; I was postponing/avoiding this advice for the right opportunity to come. Sometime in April, when I was at home on parental leave, I&#8217;ve stumbled upon <a href="http://www.simobil.si/">Si.mobil&#8217;s</a> <a href="http://www.simobil.si/android/">Prize Competition</a><sup><a href="http://www.celavi.org/2010/06/19/how-i-taught-myself-android-application-development/#footnote_0_252" id="identifier_0_252" class="footnote-link footnote-identifier-link" title="on Twitter">1</a></sup> looking for fresh <a class="zem_slink" title="Android" rel="homepage" href="http://code.google.com/android/">Android</a> Applications. Looks like <a class="zem_slink" title="Mobile software" rel="wikipedia" href="http://en.wikipedia.org/wiki/Mobile_software">mobile applications</a> are all the rage these days, so to speak. Diving into mobile <a class="zem_slink" title="Computer programming" rel="wikipedia" href="http://en.wikipedia.org/wiki/Computer_programming">development</a> can have a long and hard learning curve, since it requires knowledge of advanced programming languages like <a class="zem_slink" title="Java (programming language)" rel="homepage" href="http://java.sun.com">Java</a> and <a class="zem_slink" title="Objective-C" rel="wikipedia" href="http://en.wikipedia.org/wiki/Objective-C">Objective C</a>. Although I had only 4 weeks &#8217;till the end of the competition, I&#8217;ve decided to give Android a try. In less than a month I&#8217;ve managed to learn Android<sup><a href="http://www.celavi.org/2010/06/19/how-i-taught-myself-android-application-development/#footnote_1_252" id="identifier_1_252" class="footnote-link footnote-identifier-link" title="implements Java">2</a></sup> and create an interesting application with a cute name &#8220;<a href="/kjeseroka"><strong>KjeSeRoka</strong></a>&#8220;. I haven&#8217;t won the first prize<sup><a href="http://www.celavi.org/2010/06/19/how-i-taught-myself-android-application-development/#footnote_2_252" id="identifier_2_252" class="footnote-link footnote-identifier-link" title="the winning application actually had almost one year of development :)">3</a></sup>, but my application was interesting enough to impress the evaluation committee and I ended up amongst the top 10.</p>
<ul>
<li><a href="http://www.simobil.si/sl/actions.cp2?cid=17462440-BC56-333D-2FAF-41EA224BB0A9&amp;linkid=action">Si.mobil winning applications</a></li>
<li><a href="http://www.orto.si/android/nagrajenci-natecaja-izzivamo-ideje/">ORTO.si winning applications</a></li>
</ul>
<p>Programming in a fresh, unknown language can be very frustrating, but successfully completing an application can be equally<sup><a href="http://www.celavi.org/2010/06/19/how-i-taught-myself-android-application-development/#footnote_3_252" id="identifier_3_252" class="footnote-link footnote-identifier-link" title="if not more">4</a></sup> satisfying. The most important fact is <strong>to never give up</strong> if you don&#8217;t understand a concept at first &#8211; the best way is to keep learning and/or trying. Knowing one programming language may be good enough, but <strong>knowing four or five is much better</strong>. So my next step is to learn <strong>Objective C</strong> and port &#8220;<a href="/kjeseroka"><strong>KjeSeRoka</strong></a>&#8221; to it. To finish my thought &#8211; as of now I&#8217;m available for <strong>Android Application Development</strong> and if you have a challenging project, feel free to <a href="/contact/">contact me</a>. I’m interested in cooperation, partnering, sharing ideas and my services are, obviously, for hire too.</p>
<p>And remember, contributions earn you karma ;)</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=452d5933-cbd5-479d-8954-a8768c42a78b" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<ol class="footnotes"><li id="footnote_0_252" class="footnote">on <a class="zem_slink" title="Twitter" rel="homepage" href="http://twitter.com">Twitter</a></li><li id="footnote_1_252" class="footnote">implements Java</li><li id="footnote_2_252" class="footnote">the winning application actually had almost one year of development :)</li><li id="footnote_3_252" class="footnote">if not more</li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.celavi.org/2010/06/19/how-i-taught-myself-android-application-development/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to add plural support to Gettext Adapter in Zend Framework</title>
		<link>http://www.celavi.org/2009/07/06/how-to-add-plural-support-to-gettext-adapter-in-zend-framework/</link>
		<comments>http://www.celavi.org/2009/07/06/how-to-add-plural-support-to-gettext-adapter-in-zend-framework/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 13:08:48 +0000</pubDate>
		<dc:creator>Celavi</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[GNU gettext]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Source code]]></category>

		<guid isPermaLink="false">http://www.celavi.org/?p=121</guid>
		<description><![CDATA[This tutorial is deprecated. With Zend Framework 1.9 plural support to Gettext adapter has been implemented. One of the most popular discussions on forums, mailing lists and blogs regarding Zend Framework and its component Zend_Translate are about plural support in the gettext adapter. The Gettext Adapter is the Adapter which is used most frequently. Gettext]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.celavi.org/wp-content/uploads/2009/07/Zend_Translate_Gettext.jpg" rel="lightbox[121]"><img class="alignleft size-thumbnail wp-image-137" title="Zend_Translate_Gettext Plural Support" src="http://www.celavi.org/wp-content/uploads/2010/05/Zend_Translate_Gettext-150x150.jpg" alt="Zend_Translate_Gettext Plural Support" height="150" width="150" /></a><strong>This tutorial is deprecated. With Zend Framework 1.9 plural support to Gettext adapter has been implemented.</strong></p>
<p>One of the most popular discussions on forums, mailing lists and blogs regarding <a class="zem_slink" title="Zend Framework" rel="homepage" href="http://framework.zend.com/">Zend Framework</a> and its component Zend_Translate are about plural support in the gettext adapter. The <a class="zem_slink" title="GNU gettext" rel="homepage" href="http://www.gnu.org/software/gettext/">Gettext</a> Adapter is the Adapter which is used most frequently. Gettext is a translation source format which was introduced by <a class="zem_slink" title="GNU" rel="wikipedia" href="http://en.wikipedia.org/wiki/GNU">GNU</a>, and is now used worldwide. It is not <a class="zem_slink" title="Human-readable" rel="wikipedia" href="http://en.wikipedia.org/wiki/Human-readable">human readable</a>, but there are several freeware tools (for instance, <a href="http://www.poedit.net/">POEdit</a>), which can be very helpful. Zend_Translate does not use <a class="zem_slink" title="PHP" rel="homepage" href="http://php.net/">PHP</a>&#8216;s gettext extension because it is not multi-thread aware. Adapter reads the mo files directly, therefore it does not need PHP&#8217;s workaround. Because Zend has focused on a simple <a class="zem_slink" title="Application programming interface" rel="wikipedia" href="http://en.wikipedia.org/wiki/Application_programming_interface">API</a> which covers many sources (array, scv, gettext, ini, tbx, tmx, qt, xliff, xmltm) , implementation of plurals (which are native to translation in general, not unique to gettext) would be a hard task in early deployment of Zend Framework.</p>
<h2>First step</h2>
<p>in implementing plural support to Gettext Adapter in Zend Framework is understanding how gettext handles plural forms. I won&#8217;t get into details here, you can read more about this at <a title="Additional functions for plural forms" href="http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms">GNU / gettext</a> . For us the crucial information is about the <a class="zem_slink" title="Plural" rel="wikipedia" href="http://en.wikipedia.org/wiki/Plural">plural form</a> selections, which has to be stored in the header of entry of the PO file (the one with the empty msgid string). The plural form information looks like this:</p>
<pre class="brush: bash;">Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);</pre>
<p><a href="http://translate.sourceforge.net/wiki/l10n/pluralforms">Here</a> you can find the list of plural forms, as used by Gettext PO, that are appropriate to each language.</p>
<h2>Second step</h2>
<p>in achieving our goal would be extracting that information from PO file and storing it somewhere safe for later use. I&#8217;ve decided to store it as a translation keyword &#8220;Plural-Forms&#8221; and then use it as necessary. The supplemented code which is added to Zend_Translate_Adapter_Gettext is:</p>
<pre class="brush: php;">
//store PluralForm
if ($this-&amp;gt;_adapterInfo[$filename] != 'No adapter information available') {
    $this-&amp;gt;_data[$locale]['Plural-Forms'] = $this-&amp;gt;_getPluralForms($this-&amp;gt;_adapterInfo[$filename]);
}

/**
* Retrieve Plural-Forms string from MO file
*
* @param array $meta
* @return string
*/
protected function _getPluralForms($meta)
{
    $pluralForms = 'nplurals=2; plural=(n != 1);';
    $array = array();
    foreach (explode(&quot;\n&quot;, $meta) as $info) {
        if ($info = trim($info)) {
            list($key, $value) = explode(':', $info, 2);
        $array[trim($key)] = trim($value);
        }
    }
    if (array_key_exists('Plural-Forms', $array)) {
        $pluralForms = $array['Plural-Forms'];
    }

    return $pluralForms;
}
</pre>
<h2>Third and final step</h2>
<p>is to write a function which would return translated plural form for the provided text, plural version of text, count and optional parameters.<br />
This is just a piece of code from the whole translate class which holds Zend_Translate object (Zend_Translate_Adapter_Gettext):</p>
<pre class="brush: php;">
/**
* Translate Plural message
*
* @param string $text simple text
* @param string $plural plural version of text
* @param int $count count
* @param string/array $params
* @return string
*/
public static function translatePlural($text, $plural, $count, $params = array())
{
    //set Plural Forms String
    self::_setPluralForms();

    if(!is_string($text) || strlen($text) == 0)
        return '';

    // find out the appropriate form
    $select = self::_selectString($count);

    // this should contains all strings separated by NULLs
    $key = $text.chr(0).$plural;
    // verify if translation Exists
    self::_verifyMessage($key);

    if (!self::getInstance()-&amp;gt;_translate-&amp;gt;isTranslated($key)) {
        $translated = ($count != 1) ? $plural : $text;
    } else {
        $result = self::getInstance()-&amp;gt;_translate-&amp;gt;translate($key);
        $list = explode(chr(0), $result);
        $translated =  $list[$select];
    }
    // return formated translation
    return vsprintf($translated, $params);
}
</pre>
<h3>Use case</h3>
<p> within action controller</p>
<pre class="brush: php;">
//Change Locale to Slovene
ZendX_T::setLocale('sl_SI');
$threeSeconds = ZendX_T::translatePlural(&quot;%d second&quot;,&quot;%d seconds&quot;, 3, 3);
/**
$threeSeconds will have value '3 sekunde'
*/
</pre>
<p>The Zend Framework way of implementing this thing right would be writing a View_Helper. :) I&#8217;ll leave that task to you.</p>
<h2>Source Code</h2>
<p>Download a zip archive of the project Note: There is a file embedded within this post, please visit this post to download the file. or grab your copy at <a href="http://github.com/celavi/zf_gettext_plural/tree">GitHub</a>. Feel free to download and judge for yourself. :D</p>
<p>And remember, contributions earn you karma. ;)</p>
<h6 class="zemanta-related-title">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://robertbasic.com/blog/online-resources-for-zend-framework/">Online resources for Zend Framework</a> (robertbasic.com)</li>
</ul>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=7d523091-5e56-440e-aa10-27c273adc88c" /><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.celavi.org/2009/07/06/how-to-add-plural-support-to-gettext-adapter-in-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make old extensions work in Firefox 3.5</title>
		<link>http://www.celavi.org/2009/07/03/how-to-make-old-extensions-work-in-firefox-3-5/</link>
		<comments>http://www.celavi.org/2009/07/03/how-to-make-old-extensions-work-in-firefox-3-5/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 15:01:50 +0000</pubDate>
		<dc:creator>Celavi</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Firefox 3.5]]></category>
		<category><![CDATA[Mozilla Firefox]]></category>
		<category><![CDATA[YSlow]]></category>

		<guid isPermaLink="false">http://www.celavi.org/?p=109</guid>
		<description><![CDATA[Mozilla Firefox 3.5 was released a few days ago. This is great news for us web developers, but not all add-ons have been updated to be compatible with the new version yet, YSlow being one of them. You can force an incompatible extension to work with Firefox 3.5 by disabling the compatibly check that Firefox]]></description>
			<content:encoded><![CDATA[<p>Mozilla <a class="zem_slink" href="http://www.mozilla.com/en-US/firefox/" title="Firefox" rel="homepage">Firefox</a> 3.5 was released a few days ago. This is great news for us web developers, but not all add-ons have been updated to be compatible with the new version yet, <a href="http://developer.yahoo.com/yslow/">YSlow</a> being one of them. You can force an incompatible extension to work with Firefox 3.5 by disabling the compatibly check that Firefox performs before each install.</p>
<h2>Instructions</h2>
<ul>
<li>Type &#8220;about:config&#8221; (without quotation marks) into the <a class="zem_slink" title="Address bar" rel="wikipedia" href="http://en.wikipedia.org/wiki/Address_bar">address bar</a> and click the Agree button</li>
<li><a class="zem_slink" title="Mouse (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Mouse_%28computing%29">Right-click</a> anywhere in the window and choose New &#8211; Boolean. Name the new config value &#8220;extensions.checkCompatibility&#8221; (without quotation marks) and set it to false</li>
<li>Restart Firefox</li>
</ul>
<p>
<strong>NOTE:</strong> This might lead to unexpected behavior or even a crash. Make sure that you properly backup your add-ons before editing.</p>
<p><a href="http://www.celavi.org/wp-content/uploads/2009/07/mozilla_1.PNG" rel="lightbox[109]"><img class="aligncenter size-medium wp-image-112" title="before messing with FF 3.5 config" src="http://www.celavi.org/wp-content/uploads/2009/07/mozilla_1-300x193.PNG" alt="before messing with FF 3.5 config" height="193" width="300" /></a></p>
<div align="center">before editing Firefox 3.5 config</div>
<p><a href="http://www.celavi.org/wp-content/uploads/2009/07/mozilla_2.PNG" rel="lightbox[109]"><img class="aligncenter size-medium wp-image-113" title="New config entry" src="http://www.celavi.org/wp-content/uploads/2009/07/mozilla_2-300x156.PNG" alt="New config entry" height="156" width="300" /></a></p>
<div align="center">new config entry</div>
<p><a href="http://www.celavi.org/wp-content/uploads/2009/07/mozilla_3.PNG" rel="lightbox[109]"><img class="aligncenter size-medium wp-image-114" title="YSlow is working again" src="http://www.celavi.org/wp-content/uploads/2009/07/mozilla_3-300x247.PNG" alt="YSlow is working again" height="247" width="300" /></a></p>
<div align="center">YSlow working</div>
<p>And remember, contributions earn you karma. ;)<br />
<h6 class="zemanta-related-title">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.downloadsquad.com/2009/07/03/tweak-firefox-3-5-to-keep-running-when-you-close-all-tabs/"> Tweak Firefox 3.5 to keep running when you close all tabs </a> (downloadsquad.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.techpluto.com/latest-features-of-firefox/"> Latest Firefox&#8217;s Feature-Pack That &#8216;Chrome&#8217; Needs To Bring In </a> (techpluto.com)</li>
</ul>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=964113d6-72ae-484d-bb0a-804a106b59c7" /><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.celavi.org/2009/07/03/how-to-make-old-extensions-work-in-firefox-3-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easiest way to install VMware Tools on Ubuntu 9.04 under VMware Fusion 2.04</title>
		<link>http://www.celavi.org/2009/07/02/easiest-way-to-install-vmware-tools-on-ubuntu-9-04-under-vmware-fusion-2-04/</link>
		<comments>http://www.celavi.org/2009/07/02/easiest-way-to-install-vmware-tools-on-ubuntu-9-04-under-vmware-fusion-2-04/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 09:03:53 +0000</pubDate>
		<dc:creator>Celavi</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Ubuntu / Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[Operating system]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[VMware Fusion]]></category>
		<category><![CDATA[VMware Tools]]></category>

		<guid isPermaLink="false">http://www.celavi.org/?p=99</guid>
		<description><![CDATA[Primarily I&#8217;m using VMware Fusion for testing web applications on different operating systems and browsers. I&#8217;ve recently downloaded Ubuntu 9.04 and gave it a try. Working on guest&#160;operating system without VMware Tools installed is a real pain in the ass. The rigid constant locking/unlocking of the mouse within the window, low-res graphics&#8230; So the obvious]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.celavi.org/wp-content/uploads/2009/06/ubuntu_vmware_fusion.png" rel="lightbox[99]"><img class="alignleft size-thumbnail wp-image-106" title="Vmware Tools install" src="http://www.celavi.org/wp-content/uploads/2010/05/ubuntu_vmware_fusion-150x150.png" alt="Vmware Tools install" width="150" height="150" /></a>Primarily I&#8217;m using <a class="zem_slink" title="VMware" rel="homepage" href="http://www.vmware.com/">VMware</a> <a class="zem_slink" title="VMware Fusion" rel="homepage" href="http://www.vmware.com/products/fusion/">Fusion</a> for testing <a class="zem_slink" title="Web application" rel="wikipedia" href="http://en.wikipedia.org/wiki/Web_application">web applications</a> on different <a class="zem_slink" title="Operating system" rel="wikipedia" href="http://en.wikipedia.org/wiki/Operating_system">operating systems</a> and browsers. I&#8217;ve recently downloaded <a class="zem_slink" title="Ubuntu" rel="homepage" href="http://www.ubuntu.com/">Ubuntu</a> 9.04 and gave it a try. Working on guest&nbsp;operating system without VMware Tools installed is a real pain in the ass. The rigid constant locking/unlocking of the mouse within the window, low-res graphics&#8230; So the obvious step was clicking on the &#8220;Install VM Ware Tools&#8221; button in the menu bar.&nbsp; After unpacking the archive, installation and a restart, everything seemed to be working fine, except the mouse. I still had to lock/unlock it manually within the window! *ranting*<br />
For safety&#8217;s sake I did took a snapshot before installing these tools and have managed  to restore the system to its previous state. With some help of good ol&#8217; uncle <a class="zem_slink" title="Google" rel="homepage" href="http://google.com">Google</a> I have found the answer. My version of VMware Fusion (2.04) was released prior to the release of Ubuntu 9.04, so there are some issues with the installation. I stumbled upon <a href="http://chrysaor.info/">Chrysaor.info</a>. They&#8217;re providing VMware images for <a class="zem_slink" title="Debian" rel="homepage" href="http://www.debian.org/">Debian</a>, <a class="zem_slink" title="OpenBSD" rel="homepage" href="http://www.openbsd.org">OpenBSD</a> and <a href="http://www.ubuntu.com/">Ubuntu</a>. Check the FAQ section for: &#8220;<a href="http://chrysaor.info/?page=faq#ubuntu904_tools">How can I install VMware Tools in Ubuntu 9.04?</a>&#8220;</p>
<p>Instructions are pretty straightforward. You need to open a terminal window, execute few commands, hit Enter as defaults are OK, reboot and you are done. :D</p>
<pre class="brush: bash;">
wget http://chrysaor.info/scripts/ubuntu904vmtools.sh
sudo bash ./ubuntu904vmtools.sh
</pre>
<p>
And remember, contributions earn you karma. ;)</p>
<h6 class="zemanta-related-title">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.tuaw.com/2009/06/25/vmware-2-0-5-update-squashes-bugs-adds-10-6-support/"> VMware Fusion 2.0.5 update squashes bugs, adds 10.6 support </a> (tuaw.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.mt-soft.com.ar/2009/06/05/google-chrome-for-mac-and-linux-dev-preview/"> Google Chrome for Mac and Linux, Dev Preview </a> (mt-soft.com.ar)</li>
</ul>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=bb916d00-3c4f-4ac4-a34e-67ee255de409" /><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.celavi.org/2009/07/02/easiest-way-to-install-vmware-tools-on-ubuntu-9-04-under-vmware-fusion-2-04/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 0.505 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-03 02:52:16 --><!-- Compression = gzip -->

