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

<channel>
	<title>Buca Bay - Always nice</title>
	<atom:link href="http://www.bucabay.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bucabay.com</link>
	<description>Dua tiko noqu toa loaloa, na yacana ko... laga mai...</description>
	<pubDate>Mon, 01 Feb 2010 04:23:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Moce toka Viti</title>
		<link>http://www.bucabay.com/updates/moce-toka-viti/</link>
		<comments>http://www.bucabay.com/updates/moce-toka-viti/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 03:58:17 +0000</pubDate>
		<dc:creator>bucabay</dc:creator>
		
		<category><![CDATA[updates]]></category>

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

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

		<guid isPermaLink="false">http://www.bucabay.com/?p=353</guid>
		<description><![CDATA[Moce toka Viti. Nomu lasa e rui divi. 
Week two in Florida. Florida is a lot like Fiji, tropical weather and multi cultural. Though it would be winter, the mornings and evenings are cool, and the days almost hot. The beaches are extremely wide and smoothened by bulldozers each morning before the city wakes. Though [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.bucabay.com%2Fupdates%2Fmoce-toka-viti%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.bucabay.com%2Fupdates%2Fmoce-toka-viti%2F" height="61" width="51" /></a></div><p>Moce toka Viti. Nomu lasa e rui divi. </p>
<p>Week two in Florida. Florida is a lot like Fiji, tropical weather and multi cultural. Though it would be winter, the mornings and evenings are cool, and the days almost hot. The beaches are extremely wide and smoothened by bulldozers each morning before the city wakes. Though the manicured beaches, tall buildings and bright lights keep you on a permanent high, it also reminds me of the insustainability of our destruction of this planet.</p>
<p>My brother flew down the day I got here. I hadn&#8217;t seen him in a few years. It has been great seeing him again but we haven&#8217;t had much time to enjoy Florida due to tight work schedule. Every Sunday we go down to the beach and play some volleyball and watch the waves. At times it almost feels like Fiji. </p>
<p>I can&#8217;t wait for Vara and Joana to get here. I know they will love Florida.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bucabay.com/updates/moce-toka-viti/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Joana&#8217;s Prayer</title>
		<link>http://www.bucabay.com/general/joanas-prayer/</link>
		<comments>http://www.bucabay.com/general/joanas-prayer/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 10:54:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[general]]></category>

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

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

		<guid isPermaLink="false">http://www.bucabay.com/?p=335</guid>
		<description><![CDATA[Dear God,
I&#8217;m Sorry.
Be nice.
To Mommy and Daddy.
Amen.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.bucabay.com%2Fgeneral%2Fjoanas-prayer%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.bucabay.com%2Fgeneral%2Fjoanas-prayer%2F" height="61" width="51" /></a></div><blockquote><p>Dear God,</p>
<p>I&#8217;m Sorry.</p>
<p>Be nice.</p>
<p>To Mommy and Daddy.</p>
<p>Amen.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.bucabay.com/general/joanas-prayer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Secure password hashing and storage in PHP</title>
		<link>http://www.bucabay.com/web-development/secure-password-hashing-storage-ph/</link>
		<comments>http://www.bucabay.com/web-development/secure-password-hashing-storage-ph/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 16:23:33 +0000</pubDate>
		<dc:creator>bucabay</dc:creator>
		
		<category><![CDATA[php]]></category>

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

		<category><![CDATA[web development]]></category>

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

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

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

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

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

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

		<guid isPermaLink="false">http://www.bucabay.com/?p=325</guid>
		<description><![CDATA[Everyone knows you should never store passwords as plain text, right? 
Recently I&#8217;ve come across a lot of bad advice on how to store passwords securely. I thought I&#8217;d share a bit of my research into the subject. Like most web developers, I&#8217;m not a cryptography expert. However, this should not be the excuse we [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.bucabay.com%2Fweb-development%2Fsecure-password-hashing-storage-ph%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.bucabay.com%2Fweb-development%2Fsecure-password-hashing-storage-ph%2F" height="61" width="51" /></a></div><p>Everyone knows you should never store passwords as plain text, right? </p>
<p>Recently I&#8217;ve come across a lot of bad advice on how to store passwords securely. I thought I&#8217;d share a bit of my research into the subject. Like most web developers, I&#8217;m not a cryptography expert. However, this should not be the excuse we use when we make a database of thousands of passwords available to hackers. It is quite simple to save passwords in a reasonably secure manner. </p>
<h4>Main points: secure password hashing</h4>
<ol>
<li>Force your users to use secure passwords</li>
<li>Do not use 2 way encryption, save passwords as hashes</li>
<li>Salt each password with a unique salt</li>
<li>Hash the password and salt together multiple times (1000 or more)</li>
<li>Use an adaptive hashing technique</li>
</ol>
<h4>Cryptographic Hashes</h4>
<p>Passwords should never be stored in their original form, instead a <a href="http://en.wikipedia.org/wiki/Cryptographic_hash_function">cryptographic hash</a> must be stored. A hash function is a function that performs a<a href="http://en.wikipedia.org/wiki/One-way_function"> one way operation</a> on an input producing an output of fixed length called a digest. </p>
<p><a href="http://commons.wikimedia.org/wiki/File:Rainbow_table2.svg" alt="crytographic hash function" title="cryptographic hash function"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2b/Cryptographic_Hash_Function.svg/500px-Cryptographic_Hash_Function.svg.png" /></a></p>
<p>A popular hash function is MD5. An example in PHP:</p>
<pre>$hash = md5('test'); // 098f6bcd4621d373cade4e832627b4f6</pre>
<p>From the hash, the original text cannot be computed, however, knowing the original text you can easily compute the hash. This is the basis of saving passwords securely. </p>
<p>To verify the password, we see if it hashes to the same hash as the one we have stored. </p>
<pre>if (md5($password) == $hash) { /* password is valid */ }</pre>
<p>Notice how we never store the actual password, only the hash. We also don&#8217;t need to be able to decrypt the hash, we only have to verify it given the password supplied by the user. </p>
<p>Note I&#8217;m only using MD5 for example, since it is well known. You probably want to use a more secure hash such as SHA256 or Whirlpool as MD5 and SHA1 have a few problems (don&#8217;t ask me what they are, I don&#8217;t know). </p>
<h4>Key Based Encryption</h4>
<p>I&#8217;ve come across developers advising the use of a <a href="http://en.wikipedia.org/wiki/Key_(cryptography)">key based encryption</a>. However, this is not a secure way of storing passwords. You&#8217;re only deferring the task of having to hide the password, to having to hide the secret key. </p>
<p>Another argument is that you need to be able to retrieve the password if the user forgets it. If we backtrack to why we use passwords, we realize that allowing the user to gain access to their account is the concern, not retrieving their password. So instead, send the user a unique key (token) through email or some other authenticated resource, so the user can generate a new password. </p>
<h4>Precomputation Attacks - Rainbow Tables and salts</h4>
<p>Now, the problem with just hashing a password, is that users normally use very easy to remember passwords, which are thus very easy to guess. Due to this, there are many databases available that map all the possible passwords made up of up of alpha-numeric characters in upper and lower case, as well as a lot of special characters. There are usually in the form of <a href="http://en.wikipedia.org/wiki/Rainbow_table">rainbow tables</a>. Most do not have matches for passwords longer then 14 characters however due to the amount of computation required to generate these tables. </p>
<p><a href="http://commons.wikimedia.org/wiki/File:Rainbow_table2.svg" alt="Rainbow Table" title="Rainbow Table"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/93/Rainbow_table2.svg/500px-Rainbow_table2.svg.png" /></a></p>
<p>The way to beat rainbow tables or any other <a href="http://en.wikipedia.org/wiki/Password_cracking#Precomputation">precomputation attack</a> is to use a salt. A salt is a randomly generated input that you add to the password before hashing. This is done so that the input becomes long enough that generating a table that includes it is computationally infeasible. </p>
<p>So our hash function becomes:</p>
<pre>$salt = 'f39ae656bc79a9b2398890bb4';
$hash = md5('test'.$salt); // 1db36e73cf2e68df3640fb1052e801da </pre>
<p>Now even if the user supplies a very easy to guess password, such as &#8220;love&#8221;, it still cannot be looked up in a rainbow table because the table would have to hold the whole input, &#8220;lovef39ae656bc79a9b2398890bb4&#8243;. No public rainbow tables have that many characters in them. </p>
<h4>Use a unique salt for each password</h4>
<p>If you use the same salt for each password (a common practice in PHP applications) is a very bad idea. It allows the attacker to crack all your passwords in one go using brute force. Imagine a database with a million passwords. Each guess becomes one million times more likely to match one of those passwords. Using a unique salt for each password prevents this.</p>
<h4>Does salt size matter?</h4>
<p>Another piece of advice I&#8217;ve come across is that the size of the salt does not matter. Using common sense this is not correct. A salt such as &#8220;52e801da&#8221; will still generate the input &#8220;love52e801da&#8221; which will be in rainbow tables. </p>
<p><a href="http://en.wikipedia.org/wiki/Password%20cracking#Early_Unix_password_vulnerability">Early Unix user passwords had a vulnerability</a> that was partly due to the size of the salt. </p>
<h4>Brute Force Attacks on passwords</h4>
<p>Now even though we have mitigated precomputation attacks such as rainbow tables, we still have one issue. We have no way to hide the salt. Since we cannot hide the salt securely, we must assume it is visible. If the salt is visible, the attacker still cannot use a rainbow table, however, they can just guess the password by simply guessing passwords and then hashing them with the visible salt, then comparing the result to the stored hash. This is called a <a href="http://en.wikipedia.org/wiki/Brute_force_attack">brute force attack</a>. </p>
<p>A brute force attack in it&#8217;s simplest form, is to try every combination of passwords in sequence. However, sophisticated forms will use precomputated data such as the word combinations in a dictionary (<a href="http://en.wikipedia.org/wiki/Dictionary_attack">dictionary attack</a>) combined with statistics to find the password &#8220;love&#8221; very quickly. </p>
<h4>Better Passwords - Key Stretching and Adaptive Hashing</h4>
<p>Now the first way to combat this is to force your users to have a password at minimum 6 characters and consist of numbers as well as alphabetic characters in both upper and lower case. This is probably the best thing you could do as you have made the range of possible passwords large enough that a brute force will take a while. </p>
<p>Now you need to slow down the brute force. One way to do this is by using <a href="http://en.wikipedia.org/wiki/Key_strengthening">key strengthening</a>. This is the process of hashing multiple times, in order to make the hashing process longer. Hash functions such as MD5, SHA1 are very fast. This is not a good thing for you, since the attacker can do numerous hashes very quickly. However, if you hash 1000 times, then the attacker has to also hash each possible password the same number of times, making their brute force attack 1000 times slower. </p>
<p>Now it is up to you to figure out how many times you want to hash the password. Computational power is increasing every day, so you may also want to increase the number of times you hash the password as time progresses. There are hash functions that take this into account such as <a href="http://www.usenix.org/events/usenix99/provos/provos_html/node10.html">MD5 crypt</a> and <a href="http://www.usenix.org/events/usenix99/provos/provos_html/node1.html">BCrypt</a>. A lot of why this is needed is explained at this <a href="http://chargen.matasano.com/chargen/2007/9/7/enough-with-the-rainbow-tables-what-you-need-to-know-about-s.html">Matasano security article</a>. </p>
<h4>PHP implementation of secure password hashing</h4>
<p>Now I know this has been a rather long article, so here is what I have come up with that incorporates these methods of mitigating these password cracking techniques. </p>
<pre name="code" class="php">/**
 * Generate cryptographic Hashes for passwords
 *
 * Features:
 * 	Harderned against precomputation attacks like rainbow tables (using unique salts)
 * 	Harderned against brute force and dictionary attacks (using key stretching and optional secret key)
 *
 *  http://en.wikipedia.org/wiki/Password_cracking
 *
 *  Note: for PHP4 and lower, just remove the "public static" before function declaration
 *
 * @author gabe@fijiwebdesign.com
 * @link http://www.fijiwebdesign.com/
 * @version $Id$
 */
class Password_Hash
{

	/**
	 * Generate the Hash
	 * @return String
	 * @param $password String
	 * @param $salt String[optional]
	 * @param $iterations Int[optional]
	 * @param $secret String[optional]
	 */
	public static function generate($password, $salt = null, $iterations = 10000, $hash_function = 'sha1', $secret = '')
	{
		$salt or $salt = self::generateToken();
		$hashes = array();
		$hash = $password;
		// hash a sequence of hashes, each hash depends on the last one, so any implementation must hash each one individually
		$i = $iterations;
		while(--$i)
		{
			$hash = $hash_function($hash.$salt.$secret);
		}
		return implode(':', array($hash, $iterations, $hash_function, $salt));
	}

	/**
	 * Verify a password meets a hash
	 * @return Bool
	 * @param $password String
	 * @param $hash String
	 * @param $secret String[optional]
	 */
	public static function verify($password, $hash, $secret = '')
	{
		list($_hash, $iterations, $hash_function, $salt) = explode(':', $hash);
		return ($hash == self::generate($password, $salt, $iterations, $hash_function, $secret));
	}

	/**
	 * Generate a random hex based token
	 * @return String
	 * @param $length Int[optional]
	 */
	public static function generateToken($length = 40)
	{
		$token = array();
		for( $i = 0; $i &lt; $length; ++$i )
		{
			$token[] =	dechex( mt_rand(0, 15) );
		}
		return implode('', $token);
	}

}
</pre>
<p>Example using SHA1 with default of 10000 iterations. </p>
<pre name="code" class="php">// generating the hash
$password = 'test';
$hash = Password_Hash::generate($password);

// verifying a password
$result = Password_Hash::verify($password, $hash);

// dump results
var_dump($hash, $result);
</pre>
<p>Example using whirlpool as the hash function, a 128 length salt as well as a secret. </p>
<pre name="code" class="php">// define our custom hash function
function whirlpool($str) {
	return hash('whirlpool', $str);
}

$password = 'test';
$salt = password_Hash::generateToken(128);
$secret = password_Hash::generateToken(128);
$iterations = 10000;

// generate hash
$hash = Password_Hash::generate($password, $salt, $iterations, 'whirlpool', $secret);

// verify
$result = Password_Hash::verify($password, $hash, $secret);

// dump results
var_dump($result);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bucabay.com/web-development/secure-password-hashing-storage-ph/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Wave or Google Spreadsheet</title>
		<link>http://www.bucabay.com/xmpp/google-wave-or-google-spreadsheet/</link>
		<comments>http://www.bucabay.com/xmpp/google-wave-or-google-spreadsheet/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 16:19:53 +0000</pubDate>
		<dc:creator>bucabay</dc:creator>
		
		<category><![CDATA[xmpp]]></category>

		<category><![CDATA[concurrency control]]></category>

		<category><![CDATA[Google Wave]]></category>

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

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

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

		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://www.bucabay.com/?p=316</guid>
		<description><![CDATA[ReadWrite web posted an article titled &#8220;Google Should Stop Playing Around With Wave and Focus on Spreadsheet&#8221; a few days ago.
As the title suggests, the author believes Google is wasting time working on Google Wave and should put their efforts into Google Docs SpreadSheets.
I believe there are a few misconceptions. Google wave is not the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.bucabay.com%2Fxmpp%2Fgoogle-wave-or-google-spreadsheet%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.bucabay.com%2Fxmpp%2Fgoogle-wave-or-google-spreadsheet%2F" height="61" width="51" /></a></div><p>ReadWrite web posted an article titled &#8220;<a href="http://www.readwriteweb.com/enterprise/2009/10/google-should-focus-on-spreadsheet.php">Google Should Stop Playing Around With Wave and Focus on Spreadsheet</a>&#8221; a few days ago.</p>
<p>As the title suggests, the author believes Google is wasting time working on <a href="http://wave.google.com/">Google Wave</a> and should put their efforts into <a href="http://spreadsheets.google.com/">Google Docs SpreadSheets</a>.</p>
<p>I believe there are a few misconceptions. Google wave is not the Google Wave Client, that is in private beta. That is like saying GMail is Email. Google wave is an open protocol (like SMTP for email, or XMPP for IM) for realtime concurrency control.</p>
<blockquote><p>On the other hand, ordinary folk create real apps on spreadsheets all day long.</p></blockquote>
<p>More people use Email, IM and Social Networking. This is the areas Google Wave will be used in.</p>
<blockquote><p>Real-Time Spreadsheets? That Is So 1980s, Dude!&#8230;<br />
Online spreadsheets that anyone can edit concurrently solved the version control problem. Problem solved! Done, finished. Can we move on now?</p></blockquote>
<p>No, not just yet. Version control is not concurrency control. However, they are often used synonymously. Simplistically, version control, is the saving of changes made to a document, while concurrency control, is the merging of these changes.</p>
<p>Here is an <a href="http://www.mayvelous.com/2007/03/26/versioning-models/">overview of version control systems</a> in use today. Most of today&#8217;s version control systems such as used in Subversion, Mercurial and GIT implement a copy-modify-merge for their concurrency control. I&#8217;ve already blogged about how concurrency control in today&#8217;s <a href="http://www.bucabay.com/web-development/real-time-concurrency-control-and-version-control/">version control systems is different from realtime concurrency control</a>.</p>
<p>In the case of Google Docs, including Google Spreadsheets, there is no concurrency control. If you simultaneously edit a document with another user, any save overwrites the previous save. So if your update had not reached the user yet, it would be lost.</p>
<p>Google Wave implements true realtime concurrency control. It does this using <a href="http://www.waveprotocol.org/whitepapers/operational-transform">Operational Transformation</a> (OT), which is not new, and used by other software. What is new is that Google went ahead and defined <a href="http://www.waveprotocol.org/">a standard protocol for editing documents concurrently</a>.</p>
<p>Most importantly Google built Google Wave on top of <a href="http://xmpp.org/protocols/">XMPP</a> <a href="http://code.google.com/apis/talk/open_communications.html">Federation</a> (Open Source Instant messaging), so that anyone can host a Google Wave server by hosting an <a href="http://xmpp.org/software/servers.shtml">XMPP server</a> and/or <a href="http://xmpp.org/extensions/xep-0114.html">XMPP component</a>, just like hosting an SMTP (Email) server. They also went ahead an made an open source implementation of the <a href="http://code.google.com/p/wave-protocol/">Google Wave Server</a>. (I&#8217;ll be adding a post on how to build the Google Wave Server on CentOS 5). Already, there are other implementations of Google Wave Servers such as <a href="http://github.com/p2k/pygowave">pygowave</a> and yet to be release <a href="http://www.process-one.net/en/blogs/article/processone_wave_server_ejabberd_extension_video/">EJabberd extension</a> (XMPP for client-server also).</p>
<p>This is a very important factor. If Google had not made Google Wave an Open Standard that can be implemented by anyone, they there would be very little hype about Google Wave from developers. I wouldn&#8217;t be writing this article. Instead I&#8217;d probably be joined by others criticizing Google for creating a monopoly on a new technology. However, Google made the &#8220;right choice&#8221; and made Google Wave and open standard like the rest of the open <a href="http://www.ietf.org/">internet</a> <a href="http://www.w3.org/">standards</a>.</p>
<p>Now that we have a better understanding of what Google Wave is, we know that it:</p>
<ol>
<li>Is not a software like spreadsheets, it is a protocol</li>
<li>It offers a basis for real time concurrency control that spreadsheets do not have</li>
<li>Spreadsheets and similar applications will be built on Google wave in the future</li>
<li>Better communication and collaboration is a much greater need then better spreadsheets</li>
</ol>
<p>So you cannot say stop working on Google Wave and work on the Spreadsheets since they are not mutually exclusive. Working on Google wave will bring much needed true realtime collaboration features to spreadsheets. In fact it will bring realtime collaboration to the whole web, allowing the creation of applications that surpasses the uses of the spreadsheet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bucabay.com/xmpp/google-wave-or-google-spreadsheet/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Kama - Fiji Without You</title>
		<link>http://www.bucabay.com/video/kama-fiji-without-you/</link>
		<comments>http://www.bucabay.com/video/kama-fiji-without-you/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 05:25:22 +0000</pubDate>
		<dc:creator>bucabay</dc:creator>
		
		<category><![CDATA[song]]></category>

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

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

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

		<guid isPermaLink="false">http://www.bucabay.com/?p=311</guid>
		<description><![CDATA[

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.bucabay.com%2Fvideo%2Fkama-fiji-without-you%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.bucabay.com%2Fvideo%2Fkama-fiji-without-you%2F" height="61" width="51" /></a></div><p>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="460" height="280" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/WcEJDVBIc38&amp;hl=en&amp;fs=1&amp;" /><embed type="application/x-shockwave-flash" width="460" height="280" src="http://www.youtube.com/v/WcEJDVBIc38&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bucabay.com/video/kama-fiji-without-you/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What takeaway means</title>
		<link>http://www.bucabay.com/updates/what-takeaway-means/</link>
		<comments>http://www.bucabay.com/updates/what-takeaway-means/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 17:21:21 +0000</pubDate>
		<dc:creator>bucabay</dc:creator>
		
		<category><![CDATA[funny]]></category>

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

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

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

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

		<guid isPermaLink="false">http://www.bucabay.com/?p=302</guid>
		<description><![CDATA[By the time we got into Lautoka town today I was starving. I hadn&#8217;t had anything to eat all day.
We stopped at Pa&#8217;s kitchen, a very good restaurant  with Fijian food, but it was closed. So we head down the road to a Chinese restaurant  we hadn&#8217;t been to before, &#8220;Nina&#8217;s&#8221;. The restaurant was only a quarter full so we [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.bucabay.com%2Fupdates%2Fwhat-takeaway-means%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.bucabay.com%2Fupdates%2Fwhat-takeaway-means%2F" height="61" width="51" /></a></div><p>By the time we got into Lautoka town today I was starving. I hadn&#8217;t had anything to eat all day.</p>
<p>We stopped at Pa&#8217;s kitchen, a very good restaurant  with Fijian food, but it was closed. So we head down the road to a Chinese restaurant  we hadn&#8217;t been to before, &#8220;Nina&#8217;s&#8221;. The restaurant was only a quarter full so we order immediately at the counter. We decide to order takeaway, and and have it in the restaurant since we were sure Joana wouldn&#8217;t finish her food, and thus need a takeaway box anyway.</p>
<p>We all leisurely sit down, open each box and we&#8217;re just about to eat when we notice that we don&#8217;t have forks. Tiare, Vara&#8217;s sister walks over to the counter and asks for forks. The restaurant owner starts yelling at her and then Vara and I. &#8220;No, forks for takeaway&#8221;. Vara asks, &#8220;Do we have to pay for the forks?&#8221;. The owner yells again, &#8220;No, why you want to buy takeaway. If you want to eat here, don&#8217;t buy takeaway&#8221;. At first we&#8217;re a bit puzzled. The owner seems really hot an annoyed and then one of the waitresses starts chiming in. Vara is still puzzled and asks, &#8220;Do we have to pay extra to eat here?&#8221;. &#8220;No, we no want your money&#8221;, the restraunt owner is now fully upset.</p>
<p>The guy sitting next us blurts out, &#8220;C&#8217;mon Nina, just let them eat their food&#8221;. The two of them start quarreling. I look over to Vara, &#8220;I think we should just go, I don&#8217;t feel like eating here&#8221;. As we start leaving the owner yells at us, &#8220;You buy takeaway, you take it away!&#8221;.</p>
<p>Vara and Tiare were pretty shocked, but I&#8217;m was just about to die from laughter. That has got to be the funniest thing I&#8217;ve heard a restaurant owner say. &#8221;You buy takeaway, you TAKE IT AWAY!&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bucabay.com/updates/what-takeaway-means/feed/</wfw:commentRss>
		</item>
		<item>
		<title>&#8220;Special Price&#8221; for rugby ball in Fiji</title>
		<link>http://www.bucabay.com/updates/special-price-for-rugby-ball-in-fiji/</link>
		<comments>http://www.bucabay.com/updates/special-price-for-rugby-ball-in-fiji/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 16:53:32 +0000</pubDate>
		<dc:creator>bucabay</dc:creator>
		
		<category><![CDATA[updates]]></category>

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

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

		<guid isPermaLink="false">http://www.bucabay.com/?p=300</guid>
		<description><![CDATA[Today were were in Lautoka town, doing some shopping - mostly toys for Joana. On our way back I decided to stop at a shop and buy a rugby ball. Noticing the Adidas shop I asked our regular taxi driver, Darman, to stop there. Vara and I got out and walked up to the shop, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.bucabay.com%2Fupdates%2Fspecial-price-for-rugby-ball-in-fiji%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.bucabay.com%2Fupdates%2Fspecial-price-for-rugby-ball-in-fiji%2F" height="61" width="51" /></a></div><p>Today were were in Lautoka town, doing some shopping - mostly toys for Joana. On our way back I decided to stop at a shop and buy a rugby ball. Noticing the Adidas shop I asked our regular taxi driver, Darman, to stop there. Vara and I got out and walked up to the shop, which looked closed. There were two female employees with the same outfit standing just inside the door talking so I made hand gestures to them asking if it was closed. They affirmed my suspicious with gestures from behind the glass door.</p>
<p>We walked across the street and were just about to get into our taxi when a male employee bursts out of the shop, runs half way across the street out and yells out, &#8220;Boss boss, come come we open&#8221;. I walk back across the street and he motions for me to go inside so I do. I&#8217;m in the store looking around and there&#8217;s just him, a security guard and the too girls.</p>
<p>He asks &#8220;what you looking for boss?&#8221;. &#8220;Rugby ball&#8221;, I reply. He motions for me to follow him and there in between a bunch of rugby boots was a single rugby ball. I ask, &#8220;How much?&#8221;, pointing at it. He takes it of the shelf and hands it to me, &#8220;for you, good price, only 99 dollars&#8221;.</p>
<p>&#8220;What!&#8221;, I exclaim, taken by surprise. &#8220;You got anything else?&#8221;. He studies my expression for a while then asks, &#8220;How much you want?&#8221;. &#8220;I was looking more for something around 40 dollars, or 60 if its a match ball. This is just a size 5 training ball.&#8221;. The guy walks over to another shelf and brings out a stuffed ball that you can fit in your fist and hands it to me. &#8220;This one 30 dollars&#8221;.</p>
<p>I don&#8217;t know whether to laugh or swear at him. &#8220;Are you serious?&#8221;. All serious he exclaims, &#8220;This good ball, good souvenir.&#8221;. I look around, everyone in the shop is staring. In my best Fijian accent, &#8220;Boss, I&#8217;m from Lautoka, whats regular price for this ball&#8221;. A bit startled he looks a me, &#8220;Sorry Boss, all out of stock&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bucabay.com/updates/special-price-for-rugby-ball-in-fiji/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Watch streaming video over the LAN with VLC</title>
		<link>http://www.bucabay.com/networking/watch-streaming-vide-over-lan-with-vlc/</link>
		<comments>http://www.bucabay.com/networking/watch-streaming-vide-over-lan-with-vlc/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 11:45:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[networking]]></category>

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

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

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

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

		<category><![CDATA[MPEG-4]]></category>

		<category><![CDATA[MPEG-TS]]></category>

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

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

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

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

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

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

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

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

		<guid isPermaLink="false">http://www.bucabay.com/?p=286</guid>
		<description><![CDATA[I have a large collection of videos on my Windows PC. Before today, in order to watch the videos on my computer somewhere else in the house, we&#8217;d have to copy the movie to a USB stick and transfer it to the other computer.
Since this is an almost daily occurrence, and copying videos  can take a while, I decided to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.bucabay.com%2Fnetworking%2Fwatch-streaming-vide-over-lan-with-vlc%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.bucabay.com%2Fnetworking%2Fwatch-streaming-vide-over-lan-with-vlc%2F" height="61" width="51" /></a></div><p>I have a large collection of videos on my Windows PC. Before today, in order to watch the videos on my computer somewhere else in the house, we&#8217;d have to copy the movie to a USB stick and transfer it to the other computer.</p>
<p>Since this is an almost daily occurrence, and copying videos  can take a while, I decided to look into streaming the videos  over the Local network.</p>
<p>My first thought was to create a virtual host on my local <a href="http://www.apache.org/">Apache</a> server, and have the videos  streamed by Apache over HTTP. This worked reasonably well for a while, but after about 10 minutes or so  the video started to lag on the other side. This also happened when I tried streaming the file via FTP, using <a href="http://filezilla-project.org/">Filezilla</a> FTP server.</p>
<p>I also tried using <a href="http://nginx.net/">Nginx</a> which has an FLV streaming module. The videos on my PC are mostly .avi or .divx, so I&#8217;d have to transcode to FLV before hand in order to stream. I didn&#8217;t want to have to transcode each file to FLV, since it was already taking up a huge amount of space on my hard disk.</p>
<p>This whole time I was using <a href="http://www.videolan.org/vlc/">VLC</a> to play the videos. I had totally overlooked the fact that <a href="http://www.videolan.org/vlc/">VLC</a> was also a video streaming server. It turns out, VLC can transcode and stream at the same time (using FFMpeg internally), so you don&#8217;t need to transcode files before hand, and keep around multiple copies of the same file in different encodings.</p>
<p>Here is the article on <a href="http://www.engadget.com/2005/11/29/how-to-stream-almost-anything-using-vlc/">streaming video with VLC</a> that I followed. Pretty soon I had VLC on my PC streaming movies to multiple PCs and laptops on the local network. The videos playback can also be controlled from the streaming server, so I could start and play movies for my 2 and a half year old daughter Joana while doing my work.</p>
<p>The only problems with streaming with VLC is that you&#8217;ll have to mix and match video encodings and streaming protocols to figure out which works. For me, streaming <a href="http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC">H264</a> streamed over <a href="http://en.wikipedia.org/wiki/Real-time_Transport_Protocol">RTP</a> seemed to work best. <strong>Edit:</strong> I somehow missed their documentation on <a href="http://www.videolan.org/streaming-features.html">supported streaming protocols</a>.</p>
<h4>Step by step to setting up streaming a video with VLC over your LAN:</h4>
<ol>
<li>Open <a href="http://www.videolan.org/vlc/">VLC</a> on your PC with the video</li>
<li>Click on: <span style="color: #808080;">Media -&gt; Streaming&#8230;</span></li>
<li>Choose the video file you want to stream (double click) A window opens with the streaming options.</li>
<li> Choose RTP for the streaming protocol. For the address put in the IP* of the computer to stream to. You can leave the port number as is.</li>
<li>Choose H264 from the &#8220;profiile&#8221; dropdown. This selects &#8220;MPEG-TS&#8221; for encapsulation, H264 for Video and MPEG-4 for audio.</li>
<li>Click Stream.</li>
<li>Then on the computer you want to watch from, Open VLC.</li>
<li>Click on <span style="color: #808080;">Media -&gt; Open Network</span></li>
<li>Choose RTP and the computers IP or localhost. Leave the port number as is.</li>
<li>Click &#8220;Play&#8221;</li>
</ol>
<div>Instead of using IPs, you can also use the computer names.</div>
<div>To list the computers on the Local network by going to: <span style="color: #808080;">Start -&gt; Network</span></div>
<p>
You can also use the command line.</p>
<p>To open the command line on XP: <span style="color: #808080;">Start -&gt; Run -&gt; type in &#8220;cmd&#8221;</span> and click enter<br />
On Vista: <span style="color: #808080;">Start -&gt; type &#8220;cmd&#8221; </span>into the search box and click enter<br />
In the command prompt, type: <span style="color: #808080;">net view</span><br />
For the list of IPs: <span style="color: #808080;">arp -a</span><br />
<span style="color: #808080;">To get the IP of a computer given its name: <span style="color: #808080;">ping &lt;name&gt;</span></span></p>
<p>To get the name of the current computer: <span style="color: #808080;">hostname</span>
</p>
<p>
Before trying out VLC, I was thinking of setting up <a href="http://osflash.org/red5">Red5</a> to stream videos, since I have worked with it before to stream video and audio for <a href="http://xmpp.org/">XMPP</a> (Instant Messaging), but since VLC does the job really well and is so easy to set up, I&#8217;m sticking to that for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bucabay.com/networking/watch-streaming-vide-over-lan-with-vlc/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tsunami warning for Fiji, Twitter vs Local Radio vs Google</title>
		<link>http://www.bucabay.com/news/tsunami-warning-for-fiji-twitter-radio-google/</link>
		<comments>http://www.bucabay.com/news/tsunami-warning-for-fiji-twitter-radio-google/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 01:31:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[news]]></category>

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

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

		<category><![CDATA[real-time]]></category>

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

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

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

		<guid isPermaLink="false">http://www.bucabay.com/?p=279</guid>
		<description><![CDATA[I was woken up this morning by Vara, yelling into my ear. &#8220;There is a Tsunami warning for Fiji, wake up. Do you think it&#8217;s gonna come this far&#8221;? 
We&#8217;re about a mile from the beach, but also at an elevation of about 50m or so. I replied, &#8220;No, not gonna come this far&#8221;. I [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.bucabay.com%2Fnews%2Ftsunami-warning-for-fiji-twitter-radio-google%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.bucabay.com%2Fnews%2Ftsunami-warning-for-fiji-twitter-radio-google%2F" height="61" width="51" /></a></div><p>I was woken up this morning by Vara, yelling into my ear. &#8220;There is a Tsunami warning for Fiji, wake up. Do you think it&#8217;s gonna come this far&#8221;? </p>
<p>We&#8217;re about a mile from the beach, but also at an elevation of about 50m or so. I replied, &#8220;No, not gonna come this far&#8221;. I was up all night on a project so this was not at the slightest bit interesting to me right now. </p>
<p>In my half alseep state however, each passing car started to sound like an approaching wave, crashing through the coconut trees and quickly tearing it&#8217;s way up the hill towards us. I decided to was time to wake up.</p>
<p>I started making my tea, listening to the radio. It was going on about the Tsunami warning and evacuations etc. There was a report about that the sea was retreating in the Yasawa&#8217;s. OK, sounds like this is a real disaster. </p>
<p>The first thing that came to mind was to see if I could get more up to date information online. I typed in <strong>http://twitter.com/</strong> and did a search for &#8220;<a href="http://twitter.com/#search?q=tsunami%20fiji">tsunami fiji</a>&#8220;. </p>
<p>There were 2-3 updates every minute, and most of them stating the Tsunami warnings were already withdrawn. However, the radio was still going on with the warning. I didn&#8217;t really want to trust twitter solely, since most of it was just word of mouth.</p>
<p>I tried google, which would not have been useful in this situation a week ago. However, early this month they had implemented &#8220;search options&#8221; which allowed you to filter search results by date, showing the most recent results first. </p>
<p><a href="http://www.google.com.fj/search?q=tsunami%20fiji&#038;tbo=1&#038;tbs=rcnt:1">Google proved to be up to date</a>, with trusted information. Twitter had been just as, or maybe a few minutes ahead, but it took weeding through a few posts to finally get <a href="http://twitter.com/FranckMartin/statuses/4696268722">a trusted source</a>. </p>
<p>It didn&#8217;t take long for Fiji Times to post an update on the <a href="http://www.fijitimes.com/story.aspx?id=131129">cancelled Tsunami warning for Fiji</a>. Which was immediately <a href="http://news.google.com/news/story?q=tsunami+fiji&#038;um=1&#038;ie=UTF-8&#038;ncl=dOlmON9wT4-eLmM&#038;hl=en&#038;ei=AznNSrSMNoTGsQPJw6CxDg&#038;sa=X&#038;oi=news_result&#038;ct=more-results&#038;cd=1&#038;resnum=1">picked up by google</a>, as well as <a href="http://twitter.com/stuartinfiji/statuses/4696630775">twitter</a>.  </p>
<p>A few months ago I had the need to search for some very up to date information. Twitter provided the best source, in which google was quite useless. Now google seems to have noticed that they needed to provide realtime results. Twitter however still has the edge, with human interaction in near real-time and a wider range of resources. For example, if the Tsunami had actually hit, you could have watched it from around the world via <a href="http://twitter.com/justinf/status/4696036780">Fiji Webcam link posted on twitter</a>.</p>
<p>Now looking at this, I&#8217;m amazed at how close up to date information, especially those of large human interest such as disasters, is on the web now, mostly attributed to Twitter. Forget the radio, I&#8217;m doing a twitter search.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bucabay.com/news/tsunami-warning-for-fiji-twitter-radio-google/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Base conversion in PHP, Radix 255</title>
		<link>http://www.bucabay.com/php/base-conversion-in-php-radix-255/</link>
		<comments>http://www.bucabay.com/php/base-conversion-in-php-radix-255/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 04:54:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php]]></category>

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

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

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

		<guid isPermaLink="false">http://www.bucabay.com/?p=271</guid>
		<description><![CDATA[Allows you to convert to any base between 2 and 255, effectively using all the ASCII characters.


In order to convert very large numbers with arbitrary precision you&#8217;ll need the BCMath lib. Without BCMath the large numbers will not be converted correctly due to PHP not being able to do the arithmetic. 
If you need to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.bucabay.com%2Fphp%2Fbase-conversion-in-php-radix-255%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.bucabay.com%2Fphp%2Fbase-conversion-in-php-radix-255%2F" height="61" width="51" /></a></div><p>Allows you to convert to any base between 2 and 255, effectively using all the ASCII characters.</p>
<div id="snipplr_embed_20383" class="snipplr_embed"></div>
<p><script type="text/javascript" src="http://snipplr.com/js/embed.js"></script><script type="text/javascript" src="http://snipplr.com/json/20383"></script></p>
<p>In order to convert very large numbers with arbitrary precision you&#8217;ll need the BCMath lib. Without BCMath the large numbers will not be converted correctly due to PHP not being able to do the arithmetic. </p>
<p>If you need to convert between bases 2-36, you can use the base_convert() function. However, converting to higher bases such as 255 has some benefits, such as &#8220;compressing&#8221; the characters. </p>
<p>You can successfully compress SHA1 from a 40 byte hex to a 20 byte string. </p>
<pre class="php" name="code">echo base255(base_convert(sha1('test'), 16, 10)));</pre>
<p>Since there is no loss of data, it can be used as a lossless compression. Normal compression such as zlib won&#8217;t work on a SHA1 since there are no repeating patterns.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bucabay.com/php/base-conversion-in-php-radix-255/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
