<?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>existence, refactored &#187; Training</title>
	<atom:link href="http://blog.bryanbibat.net/category/daily-entry/training-daily-entry/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bryanbibat.net</link>
	<description>With kindness comes naïveté. Courage becomes foolhardiness. And dedication has no reward.</description>
	<lastBuildDate>Sun, 05 Feb 2012 16:22:11 +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>Coding Screencasts</title>
		<link>http://blog.bryanbibat.net/2012/01/14/coding-screencasts/</link>
		<comments>http://blog.bryanbibat.net/2012/01/14/coding-screencasts/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 07:31:09 +0000</pubDate>
		<dc:creator>Bry</dc:creator>
				<category><![CDATA[Brain Dumps]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Gosu]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[Rspec]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[screencasts]]></category>

		<guid isPermaLink="false">http://blog.bryanbibat.net/?p=1512</guid>
		<description><![CDATA[I&#8217;ve been doing some programming screencasts lately over my Youtube channel. They&#8217;re not really &#8220;screencasts&#8221; ala RailsCasts but more like informal streamed videos that you&#8217;d see in Justin.tv/Twitch.tv. These screencasts were recorded in 720p so it&#8217;s a good idea to select a higher resolution then view the videos in full screen or the large player [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing some programming screencasts lately over my Youtube channel. They&#8217;re not really &#8220;screencasts&#8221; ala <a href="http://railscasts.com/">RailsCasts</a> but more like informal streamed videos that you&#8217;d see in <a href="http://www.justin.tv">Justin.tv</a>/<a href="http://www.twitch.tv">Twitch.tv</a>.</p>
<p>These screencasts were recorded in 720p so it&#8217;s a good idea to select a higher resolution then view the videos in full screen or the large player in order for you to read the code properly.</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/videoseries?list=PLD8B9D59833F52F59&amp;hl=en_US" frameborder="0" allowfullscreen></iframe></p>
<p>Here I code a hexagonal &#8220;game of life&#8221;-like cellular automata. Used Ruby, <a href="http://www.libgosu.org/">Gosu</a>, and <a href="http://rspec.info/">RSpec</a>.</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/videoseries?list=PL8FA7120F31F16508&amp;hl=en_US" frameborder="0" allowfullscreen></iframe></p>
<p>Walking through coding a simple Rails app. Bunch of technologies discussed like <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap</a>, <a href="http://www.heroku.com/">Heroku</a>, and <a href="http://git-scm.com/">git</a>.</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/videoseries?list=PLA608CA386B07897C&amp;hl=en_US" frameborder="0" allowfullscreen></iframe></p>
<p>Going through <a href="http://projecteuler.net/">Project Euler</a> problems via brute force using Java.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bryanbibat.net/2012/01/14/coding-screencasts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learn how to setup a web server pt3: Installing MySQL and PHP apps (e.g. WordPress)</title>
		<link>http://blog.bryanbibat.net/2012/01/12/learn-how-to-setup-a-web-server-pt3-installing-mysql-and-php-apps-e-g-wordpress/</link>
		<comments>http://blog.bryanbibat.net/2012/01/12/learn-how-to-setup-a-web-server-pt3-installing-mysql-and-php-apps-e-g-wordpress/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 04:24:45 +0000</pubDate>
		<dc:creator>Bry</dc:creator>
				<category><![CDATA[Brain Dumps]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[PHP-FPM]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.bryanbibat.net/?p=1503</guid>
		<description><![CDATA[Here&#8217;s a quick update to this mini-tutorial. Previous parts can be found here and here. Installing MySQL Installing MySQL is so simple that I don&#8217;t need to hide it behind the cut. The one in the Ubuntu repositories work just fine: $ sudo apt-get install mysql-server-5.1 Note that you will be asked to enter a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bryanbibat.net/images/wordpress-installed.jpg" class="aligncenter" alt="WordPress Installed" /></p>
<p>Here&#8217;s a quick update to this mini-tutorial. Previous parts can be found <a href="http://blog.bryanbibat.net/2011/12/17/learn-how-to-setup-a-web-server-pt1-setting-up-a-practice-server/">here</a> and <a href="http://blog.bryanbibat.net/2011/12/19/learn-how-to-setup-a-web-server-pt2-installing-nginx-and-php">here</a>. </p>
<h3>Installing MySQL</h3>
<p>Installing <a href="http://www.mysql.com/">MySQL</a> is so simple that I don&#8217;t need to hide it behind the cut. The one in the Ubuntu repositories work just fine:</p>
<pre>$ sudo apt-get install mysql-server-5.1</pre>
<p>Note that you will be asked to enter a root password somewhere in the installation.</p>
<p>To wrap up the installation run</p>
<pre>$ sudo mysql_install_db</pre>
<p>to initialize the installed server and</p>
<pre>$ sudo mysql_secure_installation</pre>
<p>to secure it. </p>
<p>In <code>mysql_secure_installation</code>, you&#8217;ll be asked for your root password and then you&#8217;ll asked if you want to change it. Just enter &#8220;n&#8221; since there&#8217;s no reason to change it this early. Then you&#8217;ll be asked if you want to do some things to secure the database which is, of course, what we want to do so just hit Enter for each question to choose the default answer (&#8220;Y&#8221;).</p>
<p><span id="more-1503"></span><br />
<h3>Installing WordPress</h3>
<p>Now we go to making our Ubuntu + nginx + PHP + MySQL setup more useful by installing a web app. I choose <a href="http://wordpress.org/">WordPress</a> for this tutorial because it&#8217;s both popular and easy to install.</p>
<p>Note that most PHP web apps out there have similar installation steps i.e. install prerequisites, setup database, download and extract files, and configure the app.</p>
<p><strong>Installing prerequisites</strong></p>
<p>We only need to install a few extra components for WordPress to work on our box:</p>
<pre>$ sudo apt-get install php5-mysql php5-gd</pre>
<p><code>php5-mysql</code> is obviously required to allow PHP to connect to MySQL. <code>php5-gd</code> may be needed if you&#8217;re uploading images inside WordPress instead of using an external hosting.</p>
<p>At this point we are ready to follow the <a href="http://codex.wordpress.org/Installing_WordPress">Installing WordPress</a> guide.</p>
<p><strong>Creating the database</strong></p>
<p>I&#8217;ve switched around steps 1 and 2 because I prefer to do file-related tasks together instead of jumping from files to database to files again.</p>
<p>In setting up the database, we go with the client guide. Creating a new user isn&#8217;t part of that guide, though, so we&#8217;ll have to do that too.</p>
<p>Connect to the database using the root user:</p>
<pre>$ mysql -u root -p</pre>
<p>You will be prompted for the password before you can proceed. Once in, you can now proceed with doing what you need to do. The following lines will create a database named <code>wp</code> and a user named <code>wp_user</code> whose password is <code>password_here</code>.</p>
<pre>mysql> CREATE DATABASE wp;

mysql> CREATE USER wp_user;

mysql> SET PASSWORD FOR wp_user = PASSWORD("password_here");

mysql> GRANT ALL PRIVILEGES ON wp.* TO "wp_user"@"localhost" IDENTIFIED BY "password_here";

mysql> FLUSH PRIVILEGES;

mysql> EXIT</pre>
<p><strong>Downloading WordPress and moving it around</strong></p>
<p>Now it&#8217;s time to proceed with steps 1 and 3. Use <code>wget</code> to download and extract the latest version of WordPress:</p>
<pre>$ wget http://wordpress.org/latest.tar.gz

$ tar -zxvf latest.tar.gz</pre>
<p>We&#8217;ll then move the extracted folder <code>wordpress/</code> to <code>/var/www/</code> to centralize our web-app stuff.</p>
<pre>$ sudo mv wordpress /var/www/</pre>
<p>We also need to change the ownership for the folder:</p>
<pre>$ sudo chown -R www-data:www-data /var/www/wordpress</pre>
<p><strong>Configuring it to work</strong></p>
<p>First we need to add our database settings to <code>wp-config.php</code>:</p>
<pre>$ cd /var/www/wordpress

/var/www/wordpress$ sudo mv wp-config-sample.php wp-config.php

/var/www/wordpress$ sudo vim wp-config.php</pre>
<p>Change the settings as follows:</p>
<pre>// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wp');

/** MySQL database username */
define('DB_USER', 'wp_user');

/** MySQL database password */
define('DB_PASSWORD', 'password_here');</pre>
<p>Now to edit our nginx settings.</p>
<pre>$ sudo vim /etc/nginx/nginx.conf</pre>
<p>We&#8217;ll be using a combination of suggested settings from both nginx and WordPress documents:</p>
<pre>
...
    server {
        listen       80;
        server_name *.mysite.dev;
        root /var/www/wordpress;

        if ($http_host != "mysite.dev") {
                rewrite ^ http://mysite.dev$request_uri permanent;
        }

        # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
        location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
        }

        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }

        location / {
                # This is cool because no php is touched for static content
                try_files $uri $uri/ /index.php;
        }

        location ~ \.php$ {
                include fastcgi_params;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_pass php;
        }

        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                expires max;
                log_not_found off;
        }
    }
}
</pre>
<p>The main changes here are the update to the root (pointing it now to <code>/var/www/wordpress</code>) and the <code>try_files</code> approach of URL rewriting (which allows nginx to act like <code>mod_rewrite</code> without the use of <code>.htaccess</code>).</p>
<p><strong>Wrapping up</strong></p>
<p>Restart both PHP-FPM and nginx to apply the changes we made to both.</p>
<pre>$ sudo /etc/init.d/php5-fpm restart

$ sudo /etc/init.d/nginx restart</pre>
<p>Then go to <code>http://mysite.dev</code> to proceed with the &#8220;famous 5-minute install&#8221;.</p>
<p><img src="http://www.bryanbibat.net/images/wordpress-install.jpg" class="aligncenter" alt="WordPress Installer" /></p>
<p><img src="http://www.bryanbibat.net/images/wordpress-installed.jpg" class="aligncenter" alt="WordPress Installed" /></p>
<p>You have now successfully installed WordPress.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bryanbibat.net/2012/01/12/learn-how-to-setup-a-web-server-pt3-installing-mysql-and-php-apps-e-g-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Learn how to setup a web server pt2: Installing Nginx and PHP</title>
		<link>http://blog.bryanbibat.net/2011/12/19/learn-how-to-setup-a-web-server-pt2-installing-nginx-and-php/</link>
		<comments>http://blog.bryanbibat.net/2011/12/19/learn-how-to-setup-a-web-server-pt2-installing-nginx-and-php/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 09:41:14 +0000</pubDate>
		<dc:creator>Bry</dc:creator>
				<category><![CDATA[Brain Dumps]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[ApacheBench]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[PHP-FPM]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.bryanbibat.net/?p=1486</guid>
		<description><![CDATA[Here&#8217;s the next part of my basic web server administration tutorial. At the first part, we set up the virtual machine. Now we&#8217;ll be setting up the web server itself. Set Static IP Address and fake Domain Name Before we could proceed with installing our web server, let&#8217;s do a couple of things to make [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bryanbibat.net/images/phpinfo.png" class="aligncenter" alt="phpinfo()" /></p>
<p>Here&#8217;s the next part of my basic web server administration tutorial.</p>
<p><a href="http://blog.bryanbibat.net/2011/12/17/learn-how-to-setup-a-web-server-pt1-setting-up-a-practice-server/">At the first part</a>, we set up the virtual machine. Now we&#8217;ll be setting up the web server itself.</p>
<p><strong>Set Static IP Address and fake Domain Name</strong></p>
<p>Before we could proceed with installing our web server, let&#8217;s do a couple of things to make our server behave more like a &#8220;normal&#8221; server.</p>
<p>First is to set our server&#8217;s <a href="http://en.wikipedia.org/wiki/IP_address#IP_address_assignment">IP address</a> to a static IP address. There are a bunch of ways to do this (e.g. change the router settings), but we&#8217;ll just go with changing our server&#8217;s settings</p>
<p>Running <code>ifconfig</code> and <code>route</code> will give us the current IP address and <a href="http://en.wikipedia.org/wiki/Gateway_%28telecommunications%29">gateway</a>.</p>
<p><img src="http://www.bryanbibat.net/images/ip-route.png" class="aligncenter" alt="ifconfig and route" /></p>
<p>In this case, the new IP address is 192.168.1.125 and the gateway is 192.168.1.5. We can now apply these settings to <code>/etc/network/interfaces</code>. Open the said file via:</p>
<pre>$ sudo vim /etc/network/interfaces</pre>
<p>(For this tutorial, I&#8217;ll be using <a href="http://en.wikipedia.org/wiki/Vim_%28text_editor%29"><code>vim</code></a> as the default text editor. If you find vim too daunting, you can replace all instances of <code>vim</code> with <a href="http://en.wikipedia.org/wiki/Nano_%28text_editor%29"><code>nano</code></a>)</p>
<p>It will look something like:</p>
<pre># This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp</pre>
<p>Now replace the last line with the following:</p>
<pre>iface eth0 inet static
address [address here]
netmask 255.255.255.0
gateway [gateway here]</pre>
<p>for example:</p>
<pre>iface eth0 inet static
address 192.168.1.125
netmask 255.255.255.0
gateway 192.168.1.5</pre>
<p>To make sure you got the static IP settings correctly, you can restart the server via</p>
<pre>$ sudo shutdown -r now</pre>
<p>or you could just simply restart the network interface:</p>
<pre>$ sudo /etc/init.d/networking restart</pre>
<p>Here we see the <code>/etc/init.d</code> folder where the <a href="http://en.wikipedia.org/wiki/Init">init</a> scripts (like networking) are placed. Aside from being executed automatically upon boot to start services, they can also be used to stop or restart the said services just like what we just did with <code>networking</code>. We will see more of <code>/etc/init.d/</code> later in this tutorial.</p>
<p>Now that we&#8217;ve set the IP address as static, it&#8217;s time to set a fake <a href="http://en.wikipedia.org/wiki/Domain_name">domain name</a>.</p>
<p>Normally, when you&#8217;ve got a server with a static IP address, you&#8217;d have to go and buy a domain name from a registrar like <a href="http://www.namecheap.com/">Namecheap</a> and you&#8217;d go through the steps in linking that name with the IP address and waiting for the DNS propagation.</p>
<p>For this tutorial, we&#8217;re going to skip all that by faking it with the <a href="http://en.wikipedia.org/wiki/Hosts_%28file%29">hosts file</a>.</p>
<p>First let&#8217;s update the server&#8217;s <code>/etc/hosts</code> file to add our fake domain name &#8220;mysite.dev&#8221;:</p>
<pre>sudo vim /etc/hosts</pre>
<p>Add the line at the end:</p>
<pre>192.168.1.125   mysite.dev</pre>
<p>You can verify the new setting by using the <a href="http://en.wikipedia.org/wiki/Ping"><code>ping</code></a> command.</p>
<pre>user@ubuntu:~$ ping -c 4 mysite.dev
PING mysite.dev (192.168.1.125) 56(84) bytes of data.
64 bytes from mysite.dev (192.168.1.125): icmp_seq=1 ttl=64 time=0.172 ms
64 bytes from mysite.dev (192.168.1.125): icmp_seq=2 ttl=64 time=2.38 ms
64 bytes from mysite.dev (192.168.1.125): icmp_seq=3 ttl=64 time=3.34 ms
64 bytes from mysite.dev (192.168.1.125): icmp_seq=4 ttl=64 time=1.59 ms

--- mysite.dev ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3016ms
rtt min/avg/max/mdev = 0.172/1.874/3.342/1.161 ms
user@ubuntu:~$</pre>
<p>Now let&#8217;s apply the fake domain name mapping to the host Windows computer. Like in Linux, the hosts file in Windows requires admin privileges so we first need to run the text editor as Administrator in order to allow us to modify it.</p>
<p><img src="http://www.bryanbibat.net/images/run-as-admin.png" class="aligncenter" alt="Run as administrator" /></p>
<p>Right-click Notepad and select &#8220;Run as administrator&#8221;. Once open, you can now add the &#8220;<code>192.168.1.125 mysite.dev</code>&#8221; to the end of the <code>C:\Windows\System32\drivers\etc\hosts</code> file.</p>
<p>Now you could change the PuTTy settings to use &#8220;mysite.dev&#8221; instead of the actual IP address.</p>
<p>The actual installation of the web server below the cut.</p>
<p><span id="more-1486"></span><br />
<h3>Installing Nginx</h3>
<p>It&#8217;s finally time to install the web server.</p>
<p>We won&#8217;t be using <a href="http://en.wikipedia.org/wiki/Apache_HTTP_Server">Apache</a>, though. Instead, we&#8217;re going to go with its leaner and faster Russian counterpart <a href="http://en.wikipedia.org/wiki/Nginx">nginx</a>. We&#8217;re also going to build it from scratch (as opposed to getting it from a repository) to show you how its done in Linux machines.</p>
<p><strong>Installing dependencies</strong></p>
<p>We&#8217;ll need to install a few things before we could proceed with building nginx.</p>
<pre>$ sudo apt-get install build-essential libssl-dev libpcre3-dev</pre>
<p><code>build-essential</code> contains the essential tools for compiling programs from source while the other two are libraries that nginx needs during compilation.</p>
<p><strong>Building from source</strong></p>
<pre>~$ wget http://nginx.org/download/nginx-1.0.11.tar.gz</pre>
<p>Using <a href="http://en.wikipedia.org/wiki/Wget"><code>wget</code></a> we download the <a href="http://nginx.org/en/download.html">latest stable source</a> as of this writing. Yes, it&#8217;s a whopping 700 KB.</p>
<pre>~$ tar zxvf nginx-1.0.11.tar.gz</pre>
<p>We then unpack it using <a href="http://en.wikipedia.org/wiki/Tar_%28file_format%29"><code>tar</code></a>.</p>
<pre>~$ cd nginx-1.0.11

~/nginx-1.0.11$ ./configure --sbin-path=/usr/local/sbin --with-http_ssl_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module

~/nginx-1.0.11$ make

~/nginx-1.0.11$ sudo make install</pre>
<p>Now we finally perform the build/installation. This three-step configure-build-install scheme is pretty much how one builds any program in Linux from scratch.</p>
<p>This nginx build doesn&#8217;t come with an init script so we&#8217;ll have to download <a href="https://github.com/JasonGiedymin/nginx-init-ubuntu">one off the net</a>.</p>
<pre>~/nginx-1.0.11$ cd ~

~$ wget https://raw.github.com/JasonGiedymin/nginx-init-ubuntu/master/nginx

~$ sudo mv nginx /etc/init.d/nginx</pre>
<p>We still need to set a couple of things with the script:</p>
<pre>$ sudo chmod +x /etc/init.d/nginx

$ sudo chown root:root /etc/init.d/nginx</pre>
<p>The first command <a href="http://en.wikipedia.org/wiki/Chmod">sets the script to executable</a> and the other command <a href="http://en.wikipedia.org/wiki/Chown">gives the ownership of the script</a> to root. Now we can run nginx:</p>
<pre>$ sudo /etc/init.d/nginx start</pre>
<p>You can now open <a href="http://mysite.dev">http://mysite.dev</a> to check if it&#8217;s installed properly.</p>
<p><img src="http://www.bryanbibat.net/images/nginx-test.jpg" class="aligncenter" alt="nginx" /></p>
<p>Using Firebug or Chrome Developer tools will confirm the server&#8217;s really nginx 1.0.11.</p>
<p><img src="http://www.bryanbibat.net/images/nginx-headers.png" class="aligncenter" alt="nginx response headers" /></p>
<p><strong>Tweaking nginx</strong></p>
<p>Before we proceed with installing PHP, let&#8217;s apply some tweaks to nginx to make it more Apache-ish (lol) and then some.</p>
<pre>$ sudo ln -s /usr/local/nginx/conf /etc/nginx</pre>
<p>This creates <a href="http://en.wikipedia.org/wiki/Symbolic_link">a symbolic link</a> in the <code>/etc</code> folder to match with the <a href="http://en.wikipedia.org/wiki/Unix_directory_structure">convention for configuration files</a>.</p>
<pre>$ sudo vim /etc/nginx/nginx.conf</pre>
<p>Now we edit the configuration file like so:</p>
<pre>user  www-data;
worker_processes  1;

pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    gzip on;
    gzip_buffers 16 8k;
    gzip_disable "MSIE [1-6]\.";
    gzip_proxied any;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;
    error_log  /var/log/nginx/error.log  debug;

    sendfile        on;
    keepalive_timeout  3;
    index              index.html index.htm;

    server {
        listen       80;
        server_name *.mysite.dev;
        root /var/www;

        if ($http_host != "mysite.dev") {
                rewrite ^ http://mysite.dev$request_uri permanent;
        }

        # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
        location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
        }

    }

}
</pre>
<p>A quick summary of the changes:</p>
<ul>
<li>We changed the server&#8217;s user from &#8220;nobody&#8221; to the system user &#8220;www-data&#8221;, the default user for web servers.</li>
<li>We set the file where the <a href="http://en.wikipedia.org/wiki/Process_identifier">PID</a> for the server would be located. This will allow our init script to stop or restart the server.</li>
<li>We enabled gzip for supported browsers to dramatically reduce the bandwidth usage.</li>
<li>We set the log to match Apache&#8217;s format.</li>
<li>We defined a handler for the <code>*.mysite.dev</code> domain, defining its root to be the same as Apache&#8217;s (<code>/var/www</code>)</li>
</ul>
<p>Now to wrap things up:</p>
<pre>$ sudo cp -r /usr/local/nginx/html /var/www

$ sudo chown -R www-data:www-data /var/www</pre>
<p>We copy the <code>html</code> folder to <code>/var/www</code> and give it to <code>www-data</code>.</p>
<pre>$ sudo mkdir /var/log/nginx</pre>
<p>Just creating the log folder.</p>
<pre>$ sudo /etc/init.d/nginx destroy

$ sudo /etc/init.d/nginx start</pre>
<p>We force stop the server (as we haven&#8217;t defined the PID file when we started it) then start it normally.</p>
<p>Opening <a href="http://mysite.dev">http://mysite.dev</a> now shows us that the site is served as gzipped.</p>
<p><img src="http://www.bryanbibat.net/images/nginx-gzip.png" class="aligncenter" alt="nginx response headers" /></p>
<h3>Installing PHP-FPM</h3>
<p>Unlike nginx, we won&#8217;t be building PHP from scratch. We will, however, not go with Apache&#8217;s mod_php/extension route and instead go the <a href="http://php-fpm.org/">PHP-FPM</a> route which, like nginx, is much leaner than the former.</p>
<p>Since PHP-FPM isn&#8217;t available in the official apt repositories of Ubuntu 10.04, we will have to use another repository. Nginx&#8217;s repositories may be a bit out of date (PHP v5.3.5 vs the current v5.3.8) but it should be enough for this tutorial.</p>
<pre>$ sudo apt-get install python-software-properties

$ sudo add-apt-repository ppa:nginx/php5

$ sudo apt-get update

$ sudo apt-get install php5-fpm</pre>
<p>The steps above will install PHP-FPM with fairly decent defaults. If you want to change some settings, you can modify the files at <code>/etc/php5/fpm/</code> and restart the server via &#8220;<code>sudo /etc/init.d/php-fpm restart</code>&#8220;.</p>
<p>Now all we need to do is to tell nginx how to use PHP-FPM. Here&#8217;s our modified <code>/etc/nginx/nginx.conf</code>:</p>
<pre>user  www-data;
worker_processes  1;

pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    gzip on;
    gzip_buffers 16 8k;
    gzip_disable "MSIE [1-6]\.";
    gzip_proxied any;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;
    error_log  /var/log/nginx/error.log  debug;

    sendfile        on;
    keepalive_timeout  3;
    index              index.php index.html index.htm;

    upstream php {
        server 127.0.0.1:9000;
    }

    server {
        listen       80;
        server_name *.mysite.dev;
        root /var/www;

        if ($http_host != "mysite.dev") {
                rewrite ^ http://mysite.dev$request_uri permanent;
        }

        # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
        location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
        }

        location ~ \.php$ {
                include fastcgi_params;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_pass php;
        }
    }
}
</pre>
<p>The main changes between the original are:</p>
<ul>
<li>Adding &#8220;<code>index.php</code>&#8221; before &#8220;<code>index.html index.htm</code>&#8221; to let the server prioritize the former over the latter.</li>
<li>The addition of the <code>upstream php</code> block that points to PHP-FPM.</li>
<li>The addition of the <code>location</code> handler for PHP files.</li>
</ul>
<p>We also need to modify <code>/etc/nginx/fastcgi_params</code>, adding the following lines at the end of the file:</p>
<pre>fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;</pre>
<p>Once done we can now restart the server via <code>sudo /etc/init.d/nginx restart</code>.</p>
<p>To test PHP, create the <code>phpinfo()</code> index.php file:</p>
<pre>$ sudo sh -c 'echo "&lt;? phpinfo();" &gt; /var/www/index.php'</pre>
<p>Then open <a href="http://mysite.dev">http://mysite.dev</a> again:</p>
<p><img src="http://www.bryanbibat.net/images/phpinfo.png" class="aligncenter" alt="phpinfo()" /></p>
<p>You have now installed nginx and PHP on your web server.</p>
<h3>Benchmarking</h3>
<p>You can use <a href="http://en.wikipedia.org/wiki/ApacheBench">ApacheBench</a> to see how well your site performs under load.</p>
<pre>$ sudo apt-get install apache2-utils</pre>
<p>Here&#8217;s 1000 requests with 100 concurrent users (10 requests each user) to our static HTML file:</p>
<pre>user@ubuntu:~$ ab -n 1000 -c 100 http://mysite.dev/index.html
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking mysite.dev (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests

Server Software:        nginx/1.0.11
Server Hostname:        mysite.dev
Server Port:            80

Document Path:          /index.html
Document Length:        151 bytes

Concurrency Level:      100
Time taken for tests:   1.720 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      378290 bytes
HTML transferred:       157795 bytes
Requests per second:    581.31 [#/sec] (mean)
Time per request:       172.025 [ms] (mean)
Time per request:       1.720 [ms] (mean, across all concurrent requests)
Transfer rate:          214.75 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       27   79  15.7     84     102
Processing:    39   83  16.5     86     131
Waiting:       10   61  17.5     65      98
Total:        129  161  16.5    172     184

Percentage of the requests served within a certain time (ms)
  50%    172
  66%    173
  75%    173
  80%    173
  90%    178
  95%    182
  98%    183
  99%    183
 100%    184 (longest request)</pre>
<p>Here&#8217;s the same test against our <code>phpinfo()</code> page:</p>
<pre>user@ubuntu:~$ ab -n 1000 -c 100 http://mysite.dev/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking mysite.dev (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests

Server Software:        nginx/1.0.11
Server Hostname:        mysite.dev
Server Port:            80

Document Path:          /
Document Length:        42481 bytes

Concurrency Level:      100
Time taken for tests:   8.582 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      42649000 bytes
HTML transferred:       42481000 bytes
Requests per second:    116.52 [#/sec] (mean)
Time per request:       858.186 [ms] (mean)
Time per request:       8.582 [ms] (mean, across all concurrent requests)
Transfer rate:          4853.19 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    6  16.6      0      63
Processing:    66  810 126.3    861     875
Waiting:       59  808 127.0    858     873
Total:        125  816 113.2    861     875

Percentage of the requests served within a certain time (ms)
  50%    861
  66%    862
  75%    863
  80%    864
  90%    869
  95%    874
  98%    874
  99%    875
 100%    875 (longest request)</pre>
<p>581 and 116 requests per second? Not bad for a &#8220;low end&#8221; server.</p>
<p><a href="http://blog.bryanbibat.net/2012/01/12/learn-how-to-setup-a-web-server-pt3-installing-mysql-and-php-apps-e-g-wordpress/" title="Learn how to setup a web server pt3: Installing MySQL and PHP apps (e.g. WordPress)">Proceed to part 3: Installing MySQL and WordPress</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bryanbibat.net/2011/12/19/learn-how-to-setup-a-web-server-pt2-installing-nginx-and-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Code Retreat Baguio 2011</title>
		<link>http://blog.bryanbibat.net/2011/12/05/code-retreat-baguio-2011/</link>
		<comments>http://blog.bryanbibat.net/2011/12/05/code-retreat-baguio-2011/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 02:15:09 +0000</pubDate>
		<dc:creator>Bry</dc:creator>
				<category><![CDATA[Brain Dumps]]></category>
		<category><![CDATA[Event Report]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[code retreat]]></category>

		<guid isPermaLink="false">http://blog.bryanbibat.net/?p=1452</guid>
		<description><![CDATA[So after spending the entire day walking around doing stuff (and at one point get wrangled into MCing) for DevCon at DevOpsDays, me and a couple PhRUG guys got on a (red-eye?) bus to Baguio City for the non-official Philippine leg of the Global Day of Code Retreat. This isn&#8217;t a full write-up of the [...]]]></description>
			<content:encoded><![CDATA[<p>So after spending the entire day walking around doing stuff (and at one point get wrangled into MCing) for <a href="http://devcon.ph">DevCon </a>at <a href="http://www.devopsdays.org/events/2011-manila/">DevOpsDays</a>, me and a couple PhRUG guys got on a (red-eye?) bus to Baguio City for the <a href="http://groups.google.com/group/ruby-phil/browse_thread/thread/142920c66a3bb24e">non-official Philippine leg</a> of the <a href="http://blog.coderetreat.com/global-day-of-coderetreat">Global Day of Code Retreat</a>.</p>
<p>This isn&#8217;t a full write-up of the event so I&#8217;ll keep this short and simple. The event was at <a href="https://twitter.com/dreinavarro">Drei</a>&#8216;s place with just a bunch of Ruby, Python, and PHP guys from both Manila and Baguio hacking up random stuff instead of doing the whole Code Retreat thing.</p>
<div class="wp-caption"><a href="http://instagr.am/p/XHQCe/"><img class="aligncenter" src="http://www.bryanbibat.net/images/picture_while_you_picture.jpg" alt="after event" /></a></p>
<p class="wp-caption-text">at the after event, aka &#8220;Yo dawg, I heard <a href="http://www.bridgeutopiaweb.com/">you</a> like taking pictures so here&#8217;s a picture of people taking your picture so you can have a picture of you taking pictures of people taking pictures&#8221;</p>
</div>
<p>Being the slacker that I am, I didn&#8217;t have anything planned out beforehand. I thought I&#8217;d just go the same route as with Startup Weekend Manila and just be a <a href="http://c2.com/cgi/wiki?RubberDucking">rubber duck</a> floating around groups. Fortunately, <a href="https://twitter.com/keikun17">Buddy</a> brought along his significant other Rizza with the intention of having her learn programming from the participants of the event. </p>
<p>I couldn&#8217;t resist this teaching challenge. So for the entire event, I went on to give an impromptu crash course on the <a href="http://blog.bryanbibat.net/tag/fundamentals/">fundamentals of software development</a>. </p>
<p>I started off with basic imperative/procedural programming via pseudocode (to drill in the idea that software development is not about computers but about solving problems). As we progressed I moved on to Ruby for the more technical side of things (basic data types) up to <a href="http://blog.bryanbibat.net/tag/object-oriented/">Object Oriented basics</a>.</p>
<div class="wp-caption"><img class="aligncenter" src="http://www.bryanbibat.net/images/lesson-page1-2.jpg" alt="first lesson" /></p>
<p class="wp-caption-text">first programs &#8211; potato salad and quadratic formula</p>
</div>
<p>By mid-day, I had this little flash of insanity and began downloading >250MB of development stuff from a certain site.</p>
<p>That flash of insanity was to go back to the original Code Retreat exercise, <a href="http://coderetreat.com/gol.html">Conway&#8217;s Game of Life</a>, and build it in Java to teach software development: <a href="http://blog.bryanbibat.net/2009/09/03/code-conventions/">coding conventions</a>, <a href="http://blog.bryanbibat.net/tag/revision-control/">revision control</a>, <a href="http://en.wikipedia.org/wiki/Test_automation">test automation</a>, <a href="http://blog.bryanbibat.net/2009/08/25/refactoring/">refactoring</a>, etc.</p>
<p>Of course, I had to teach the most crucial concept in software development: <em>how to wing it</em>. And that was where Android came in.</p>
<p><iframe width="480" height="360" src="http://www.youtube.com/embed/-Kcu1fGUo1Q" frameborder="0" allowfullscreen></iframe></p>
<p>So we had a base GoL class and a freshly installed Android SDK. A couple of Google searches later and a lot of guesswork, we were able to make the whole thing work as a <a href="http://developer.android.com/resources/articles/live-wallpapers.html">Live Wallpaper</a> in around 1.5 hours.</p>
<p><img class="aligncenter" src="http://www.bryanbibat.net/images/device-gol-ss.png" alt="screenshot of wallpaper" /></p>
<p>Lack of sleep and preparation can turn a Ruby guy into a Java developer. LOL</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bryanbibat.net/2011/12/05/code-retreat-baguio-2011/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Vocal Retraining</title>
		<link>http://blog.bryanbibat.net/2011/11/30/vocal-retraining/</link>
		<comments>http://blog.bryanbibat.net/2011/11/30/vocal-retraining/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 10:09:19 +0000</pubDate>
		<dc:creator>Bry</dc:creator>
				<category><![CDATA[Brain Dumps]]></category>
		<category><![CDATA[Cooking]]></category>
		<category><![CDATA[Site News]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[podcasts]]></category>

		<guid isPermaLink="false">http://blog.bryanbibat.net/?p=1447</guid>
		<description><![CDATA[..or podcast, whatever you want to call it. So I&#8217;m gonna be recording rants for the next few weeks to figure out and fix my vocal problems. I&#8217;m ok with topic suggestions but I&#8217;m not really expecting any. Will be posting the recordings on this site until I get to setup another page for the [...]]]></description>
			<content:encoded><![CDATA[<p>..or podcast, whatever you want to call it.</p>
<p>So I&#8217;m gonna be recording rants for the next few weeks to figure out and fix my vocal problems. I&#8217;m ok with topic suggestions but I&#8217;m not really expecting any.</p>
<p>Will be posting the recordings on this site until I get to setup another page for the recordings (probably a wiki).</p>
<p><a href="http://files.bryanbibat.net/episode0-64.mp3">Episode 0 &#8211; Intro</a></p>
<p><a href="http://files.bryanbibat.net/episode1-64.mp3">Episode 1 &#8211; Pizza (pt1 of 2)</a></p>
<p><a href="http://files.bryanbibat.net/episode2-64.mp3">Episode 2 &#8211; Pizza (pt2 of 2)</a></p>
<p>&#8211;</p>
<p><strong>UPDATE</strong></p>
<p>Podcasts now posted daily at <a href="http://bry-rants.tumblr.com/">http://bry-rants.tumblr.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bryanbibat.net/2011/11/30/vocal-retraining/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://files.bryanbibat.net/episode0-64.mp3" length="5403018" type="audio/mpeg" />
<enclosure url="http://files.bryanbibat.net/episode1-64.mp3" length="8877736" type="audio/mpeg" />
<enclosure url="http://files.bryanbibat.net/episode2-64.mp3" length="11893100" type="audio/mpeg" />
		</item>
		<item>
		<title>Latest Trends in Open Source Web Technologies</title>
		<link>http://blog.bryanbibat.net/2011/11/28/latest-trends-in-open-source-web-technologies/</link>
		<comments>http://blog.bryanbibat.net/2011/11/28/latest-trends-in-open-source-web-technologies/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 12:04:23 +0000</pubDate>
		<dc:creator>Bry</dc:creator>
				<category><![CDATA[Brain Dumps]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[public talk]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.bryanbibat.net/?p=1443</guid>
		<description><![CDATA[Last talk for the year (barring a possible surprise talk at Code Retreat): a talk about current trends in web technologies at DevCon UPHSD. This time it&#8217;s a 20 minute talk that I had to drag out to 40+ minutes to cover for the missing speakers. Good thing I wasn&#8217;t pressured to deliver it in [...]]]></description>
			<content:encoded><![CDATA[<p>Last talk for the year (barring a possible surprise talk at Code Retreat): a talk about current trends in web technologies at DevCon UPHSD. This time it&#8217;s a 20 minute talk that I had to drag out to 40+ minutes to cover for the missing speakers. Good thing I wasn&#8217;t pressured to deliver it in English.</p>
<p>So yeah, we had 2 missing speakers, leaving <a href="http://www.linkedin.com/pub/alvin-edwald-chan/12/3aa/a09">Alvin</a> and I to handle everything.</p>
<p>But surprisingly, this DevCon event was far better than the one in DLSU (<em>read: a more prestigious university</em>) mainly because the students were really interested in what the two of us have to say. Sure, our talks may have been boring for most of the audience, but by the time we left the campus, we&#8217;ve fielded over a dozen questions, mostly from students who approached us after the event ended.</p>
<p>In comparison, AFAIK, only one student asked a question in DLSU. </p>
<p>Pride? Apathy? I really don&#8217;t know.</p>
<p>Anyway, here&#8217;s my talk and the slides.</p>
<p><iframe width="480" height="360" src="http://www.youtube.com/embed/CmX1U0IvgOc" frameborder="0" allowfullscreen></iframe></p>
<div style="width:425px" id="__ss_10353220"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/bryanbibat/latest-trends-in-open-source-web-technologies" title="Latest Trends in Open Source Web Technologies" target="_blank">Latest Trends in Open Source Web Technologies</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/10353220" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/bryanbibat" target="_blank">bryanbibat</a> </div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.bryanbibat.net/2011/11/28/latest-trends-in-open-source-web-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What it takes to be a Web Developer</title>
		<link>http://blog.bryanbibat.net/2011/11/26/what-it-takes-to-be-a-web-developer/</link>
		<comments>http://blog.bryanbibat.net/2011/11/26/what-it-takes-to-be-a-web-developer/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 08:24:11 +0000</pubDate>
		<dc:creator>Bry</dc:creator>
				<category><![CDATA[Brain Dumps]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[public talk]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.bryanbibat.net/?p=1439</guid>
		<description><![CDATA[Did a lightning talk for DevCon DLSU last Wednesday. Not really liking the end result. My decision to deliver it in English is mainly to blame: I wrongly guessed that La Salle students would react better to English than Tagalog (the latter I prefer when giving talks), and all I got from it was having [...]]]></description>
			<content:encoded><![CDATA[<p>Did a lightning talk for <a href="http://devcon.ph">DevCon</a> DLSU last Wednesday. Not really liking the end result. My decision to deliver it in English is mainly to blame: I wrongly guessed that La Salle students would react better to English than Tagalog (the latter I prefer when giving talks), and all I got from it was having my lack of practice look more obvious. </p>
<p>I think the worst part about my talk was the way how the &#8220;sarcastic-whiny-tone&#8221; I use in my normal everyday Tagalog creeped into my usually more professional sounding English voice. I&#8217;ll probably have to do weeks of voice retraining to eliminate that. =/</p>
<p>Anyway, here is the video of the talk as well as the slides.</p>
<p><iframe width="480" height="360" src="http://www.youtube.com/embed/B1wFvxxgTSE" frameborder="0" allowfullscreen></iframe></p>
<div style="width:425px" id="__ss_10280955"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/bryanbibat/what-it-takes-to-be-a-web-developer" title="What it takes to be a Web Developer" target="_blank">What it takes to be a Web Developer</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/10280955" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/bryanbibat" target="_blank">bryanbibat</a> </div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.bryanbibat.net/2011/11/26/what-it-takes-to-be-a-web-developer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solve LibreOffice&#8217;s SlideShare and Windows Anti-aliasing Problems</title>
		<link>http://blog.bryanbibat.net/2011/09/22/solve-libreoffices-slideshare-and-windows-anti-aliasing-problems/</link>
		<comments>http://blog.bryanbibat.net/2011/09/22/solve-libreoffices-slideshare-and-windows-anti-aliasing-problems/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 15:03:50 +0000</pubDate>
		<dc:creator>Bry</dc:creator>
				<category><![CDATA[Brain Dumps]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[LibreOffice]]></category>

		<guid isPermaLink="false">http://blog.bryanbibat.net/?p=1404</guid>
		<description><![CDATA[I frequently make slides but since I don&#8217;t like paying for Office/iWork and I haven&#8217;t drunk the Google Docs kool-aid yet, my tool of choice for presentations is LibreOffice Impress. LibreOffice is more than sufficient for my needs. There are, however, two major problems I&#8217;ve encountered so far: ODP format isn&#8217;t fully supported by SlideShare, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bryanbibat.net/images/impress-aa.png" class="aligncenter" alt="antialiasing" /></p>
<p>I <a href="http://blog.bryanbibat.net/tag/public-talk/">frequently make slides</a> but since I don&#8217;t like paying for Office/iWork and I haven&#8217;t drunk the Google Docs kool-aid yet, my tool of choice for presentations is <a href="http://www.libreoffice.org/">LibreOffice Impress</a>.</p>
<p>LibreOffice is more than sufficient for my needs. There are, however, two major problems I&#8217;ve encountered so far:</p>
<ol>
<li>ODP format isn&#8217;t fully supported by <a href="http://www.slideshare.net">SlideShare</a>, as you could see from my <a href="http://www.slideshare.net/bryanbibat/haml-sass-presentation-4923338">Haml presentation</a> last year.</li>
<li>I sometimes present in Windows (e.g. Rails workshops with everyone in the audience using Windows) and I&#8217;ve noticed that <a href="http://en.wikipedia.org/wiki/Spatial_anti-aliasing">anti-aliasing</a> sucks in that OS even in 3.4.3rc. With me having very good eyesight combined with most of the text in my slides being large phrases (i.e. the proper way to build slides), those jagged edges can be annoying.</li>
</ol>
<p>Fortunately, there&#8217;s a simple solution to both of these problems: </p>
<p><strong>Export to PDF</strong></p>
<p>By exporting to PDF, you bundle the correct fonts in the document. Also, this approach leaves the anti-aliasing to your PDF reader which is more likely to have better AA rendering. </p>
<p>The picture at the top of this post shows the difference between LibreOffice and <a href="http://www.tracker-software.com/product/pdf-xchange-viewer">PDF-XChange Viewer</a>&#8216;s AA rendering, respectively.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bryanbibat.net/2011/09/22/solve-libreoffices-slideshare-and-windows-anti-aliasing-problems/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Free Rails 3.0 tutorial/manual</title>
		<link>http://blog.bryanbibat.net/2011/09/01/free-rails-3-0-tutorialmanual/</link>
		<comments>http://blog.bryanbibat.net/2011/09/01/free-rails-3-0-tutorialmanual/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 07:51:52 +0000</pubDate>
		<dc:creator>Bry</dc:creator>
				<category><![CDATA[Brain Dumps]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.bryanbibat.net/?p=1397</guid>
		<description><![CDATA[Computer Science teachers have it easy. Every time a new semester rolls in, they can simply reuse the material they&#8217;ve been using for years. As a teacher of a quickly evolving web framework, I do not have that luxury. As I write this, less than 24 hours have passed since the Rails Core team released [...]]]></description>
			<content:encoded><![CDATA[<p>Computer Science teachers have it easy. Every time a new semester rolls in, they can simply reuse the material they&#8217;ve been using for years.</p>
<p>As a teacher of a quickly evolving web framework, I do not have that luxury.</p>
<p>As I write this, less than 24 hours have passed since the Rails Core team released the new version of Ruby on Rails: version 3.1.0. This means that I now have to update my student manual (i.e. this document) for upcoming classes to use this new version. Having done that before when we moved from Rails 2.3. to Rails 3.0, I know how much of this document will be changed: sections will be gutted, swaths of code rewritten, and at least one new chapter would be added.</p>
<p>And, yet again, I will not be paid a single cent for those updates.</p>
<p>So instead of just letting this nearly obsolete document go to waste, I&#8217;ve decided to give it away for free.</p>
<p><strong><a href="https://github.com/bryanbibat/rails-3_0-tutorial">Get it here.</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bryanbibat.net/2011/09/01/free-rails-3-0-tutorialmanual/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sowing the Seeds</title>
		<link>http://blog.bryanbibat.net/2011/04/23/sowing-the-seeds/</link>
		<comments>http://blog.bryanbibat.net/2011/04/23/sowing-the-seeds/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 03:53:06 +0000</pubDate>
		<dc:creator>Bry</dc:creator>
				<category><![CDATA[Brain Dumps]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[public talk]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.bryanbibat.net/?p=1297</guid>
		<description><![CDATA[Just a quick write-up of my Pecha Kucha talk for RedDotRubyConference last night. Sowing the Seeds View more presentations from bryanbibat Full &#8220;script&#8221; below the cut. If you&#8217;ve been there in my talk, I ad-libbed a lot more this time around than when I did my Ignite talk. 1 (picture source) Good evening. I&#8217;m Bry, [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick write-up of my Pecha Kucha talk for <a href="http://reddotrubyconf.com/">RedDotRubyConference</a> last night. </p>
<div style="width:425px" id="__ss_7708099"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/bryanbibat/sowing-the-seeds-7708099" title="Sowing the Seeds">Sowing the Seeds</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/7708099" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/bryanbibat">bryanbibat</a> </div>
</p></div>
<p>Full &#8220;script&#8221; below the cut. If you&#8217;ve been there in my talk, I ad-libbed a lot more this time around than when I did <a href="http://blog.bryanbibat.net/2010/03/04/my-ignite-manila-talk/">my Ignite talk</a>.</p>
<p><span id="more-1297"></span><br />
1<br />
(<a href="http://www.flickr.com/photos/ricephotos/4275813924/">picture source</a>)</p>
<p>Good evening. I&#8217;m Bry, a Filipino software developer still living in the Philippines. </p>
<p>For the non-rubyists here, don&#8217;t worry, this talk is simple enough and you might learn something new. Just expect jargon.</p>
<p>As we all know, what they teach you in college isn&#8217;t what you get in the real world.</p>
<p>2 (<a href="http://www.feu-eastasia.edu.ph/">Far Eastern University &#8211; East Asia College</a>)</p>
<p>Fortunately, the students know this, and they often ask us local Rubyists to give talks in their campuses.<br />
And since Matz is nice, so we are nice&#8230; so we&#8217;re happy to oblige. </p>
<p>3 (<a href="http://www.perpetualdalta.edu.ph/">University of Perpetual Help System DALTA</a>)</p>
<p>Just this year alone, we&#8217;ve already visited 5 schools and we expect to do more later this year. </p>
<p>This talk is a culmination of the lessons I learned from making talks; what works and what doesn&#8217;t when introducing Ruby to students. </p>
<p>4</p>
<p>Everything begins with knowing your audience.</p>
<p>A couple of years back, I was at a conference where the guy in front was talking about how cool this web framework was (no it&#8217;s not Rails). </p>
<p>Problem was, it wasn&#8217;t your usual conference. He didn&#8217;t realize that his audience consisted mainly of undergrads.</p>
<p>5</p>
<p>No one understood what he was saying.</p>
<p>Moral of the story: Keep it simple. You&#8217;re not there to confuse people, you&#8217;re there to introduce new ideas.</p>
<p>Actually, keeping things simple is just the first step. Your real initial goal is to make an impression.</p>
<p>6 (also University of Perpetual Help System DALTA)</p>
<p>This is me in front of over 500 students. Note that the students are glued to the screen; they&#8217;re not talking or sleeping.</p>
<p>And note that I didn&#8217;t have a microphone, no lapel or wireless or anything. I was able to do this simply by making a good impression.</p>
<p>So how do you make an impression?</p>
<p>7<br />
(<a href="http://www.pupsanpedro.info/">Polytechnic University of the Philippines, San Pedro Laguna</a><br />
<a href="http://prezi.com/xxkoakpylhlk/ruby-on-rails/">Here</a> is the Prezi presentation showed throughout the talks)</p>
<p>First thing to do is to ditch PowerPoint. These are college students, and if they see another freaking wall of text even outside their classroom, they&#8217;re going to sleep or do things that you wouldn&#8217;t want them to do.</p>
<p>I personally use Prezi over PowerPoint. It works wonders just as long as you don&#8217;t get your audience seasick.</p>
<p>8 </p>
<p>A much better way to blow their mind is to give them a demo, which is what the web framework fanboy should have done. Spend 5 minutes building &#8220;Twitter&#8221; from installation to working app and you&#8217;re going to blow their minds. You&#8217;ll make a really big impression. </p>
<p>9 </p>
<p>If the talk takes more than 30 mins, I try to go beyond Rails and amaze them with Ruby. This line above may look simple to us, but it&#8217;s enough to freak out people who aren&#8217;t exposed to Functional Programming and real OOP.</p>
<p>10 (<a href="http://www.apc.edu.ph/">Asia Pacific College</a>) + 11</p>
<p>The next step is to make Ruby as accessible as possible. This has stirred a bit of a controversy in the past, most of it comes from my decision to forgo Macs when I make my presentations. </p>
<p>My reasoning is that I&#8217;m talking to third world college students. In my opinion, it gives the impression to them they need a Mac before they could explore Ruby, which is certainly not the case. It&#8217;ll run perfectly fine on whatever OS they have on their PCs, typically windows.</p>
<p>And so I demo with Windows.</p>
<p>12</p>
<p>On a similar note, while some of you are already sick of Rails, I still go with Rails in my demo instead of Sinatra because, aside from the one click installer and scaffold script, the audience would be more likely to find info or tutorials about the former.</p>
<p>13 (also Asia Pacific College)</p>
<p>So now we&#8217;ve got their attention by blowing their minds and making Ruby accessible, so now you just have to make things stick. You can do this by letting them try it on their own.</p>
<p>There are many ways to go about this, but I prefer the online interactive tutorial route.</p>
<p>14 </p>
<p><a href="http://tryruby.org/">TryRuby.org</a> is a good place to start. It&#8217;s browser based so they don&#8217;t need to install anything. The interactive tutorial is so-so, but it should whet their appetite enough to start looking for other resources.</p>
<p>15</p>
<p>On the Rails side, you&#8217;ve got <a href="http://railsforzombies.org/">RailsForZombies</a>. Thanks to Facebook and Zynga, everyone has a browser with flash, and no one has an excuse not to try learning Rails with this online tutorial.</p>
<p>At this point you&#8217;ll probably have people scrambling for writing materials to take down those URLs. But there&#8217;s still going to be a part of the audience that will be skeptical.</p>
<p>16 (<a href="http://www.adamson.edu.ph/">Adamson University</a>)</p>
<p>Whether they come up to the mic or not, they&#8217;ll have this question in their mind: will I get a job using such exotic language?</p>
<p>Of course, we know that&#8217;s a stupid question. But since &#8220;Matz is nice, so we are nice&#8221;, we can&#8217;t directly tell that to them.</p>
<p>17 </p>
<p>I simply point out the facts.</p>
<p>There&#8217;s a really high demand for Ruby developers in our country.<br />
Most of us freelancers are juggling more than 2 gigs at a time.<br />
We have the money to go to Singapore or buy MacBook Pros.</p>
<p>18</p>
<p>At this point, you&#8217;ve convinced all those you can convince. At this point, I simply I end my talks by pointing the audience to our Ruby local user group to provide a venue for follow up questions. </p>
<p>We also have monthly meet-ups in case they want to ask questions in real life.</p>
<p>19 </p>
<p>And we have a group website <a href="http://pinoyrb.org">PinoyRB.org</a>. Right now it&#8217;s just a blog aggregator, but when we get the time we could probably build a more badass site.</p>
<p>Well, that&#8217;s it for my talk.</p>
<p>20<br />
(<a href="http://en.wikipedia.org/wiki/File:Inception_ver3.jpg">picture source</a> &#8211; used under fair use)</p>
<p>To sum it all up: think Inception. Planting simple ideas deep enough will get you more response than a hundred powerpoint slides.</p>
<p>Thank you for listening and good night.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bryanbibat.net/2011/04/23/sowing-the-seeds/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

