<?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>Creative Bytes Blog</title>
	<atom:link href="http://creativebytes.co.za/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://creativebytes.co.za/blog</link>
	<description></description>
	<lastBuildDate>Mon, 10 Aug 2009 14:22:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ubuntu not recognizing eth0 network</title>
		<link>http://creativebytes.co.za/blog/2009/08/10/ubuntu-not-recognizing-eth0-network/</link>
		<comments>http://creativebytes.co.za/blog/2009/08/10/ubuntu-not-recognizing-eth0-network/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 13:41:21 +0000</pubDate>
		<dc:creator>Geoff Garbers</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://creativebytes.co.za/blog/?p=53</guid>
		<description><![CDATA[I&#8217;ve just managed to get my network repaired on my home server that I&#8217;ve been running for a little while now. For some reason, Ubuntu decided to not load the module required for the ethernet card :/ I&#8217;ve outlined the steps I took to get it working (there were some others, but this was the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just managed to get my network repaired on my home server that I&#8217;ve been running for a little while now. For some reason, Ubuntu decided to not load the module required for the ethernet card :/ I&#8217;ve outlined the steps I took to get it working (there were some others, but this was the route that <em>actually</em> worked for me), mainly to help others who encounter the same situation; but also for my own use next time it happens <img src='http://creativebytes.co.za/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <span id="more-53"></span></p>
<p>Firstly, as a disclaimer, I am <strong>not</strong> a Linux guru or expert. Most of the reasons behind what I did is beyond me, and I&#8217;m just outlining what it is that I did. Where I can though, I&#8217;ll point out the reasoning behind what I did. Secondly, if you&#8217;re not wanting the long-winded walkthrough, you can take a look at the summary at the very bottom.</p>
<p>Okay, so, first of all, I tried executing <em>ifconfig</em>, the see which network interfaces were being returned to me. Predictably enough, <em>eth0</em> was not being returned in this list.</p>
<p>Next thing I did was executed <em>lspci -v | grep -i ethernet</em>, which returned the details of my network card. So, after this little exercise, I know that Ubuntu is picking up my network card, but it doesn&#8217;t seem to be loading it correctly &#8211; if at all.</p>
<p>So, after some reading up on the intertubes (<a href="http://ubuntuforums.org/showthread.php?t=834225">here</a> and <a href="http://ubuntuforums.org/archive/index.php/t-2226.html">here</a>), I took a look at the file located at <em>/etc/udev/rules.d/70-persistent-net.rules</em>. Within the file, there is a line that says &#8220;PCI device&#8230; &#8220;, with a module name in brackets at the end. I selected this module name, and then installed the module (<em>modprobe &#8220;module_name&#8221;</em>). I then reloaded networking, and everything was hunky dory and working again! Thankully, there wasn&#8217;t <em>too</em> much hassle involved! The only thing is, is that I haven&#8217;t tested whether this holds through another restart, or whether I&#8217;ll have to do the same thing when the server is restarted again.</p>
<p>But now, the summary of the steps taken:</p>
<ol>
<li>Check if network card is loaded and recognized (<em>ifconfig eth0</em>, then <em>lspci -v | grep -i ethernet</em>).</li>
<li>Retrieved module name from <em>/etc/udev/rules.d/70-persistent-net.rules</em> (The bracketed text at the end of the &#8220;PCI device&#8230;&#8221; line)</li>
<li>Executed <em>modprobe module_name</em>.</li>
<li>Reloaded networking: <em>sudo /etc/init.d/networking restart</em>.</li>
<li><em>ifconfig</em>, to ensure that it has been enabled correctly.</li>
</ol>
<p>If you have anything to add, then let us all know in the comments.</p>
<p><strong>UPDATE:</strong> I&#8217;ve just tested it when restarting, and the module was not loaded dynamically. This was easily remedied by adding another line to the <em>/etc/modules</em> file, with the module name on it&#8217;s own line. Restart, and you&#8217;ll see that it should be loaded on boot <img src='http://creativebytes.co.za/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://creativebytes.co.za/blog/2009/08/10/ubuntu-not-recognizing-eth0-network/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m back</title>
		<link>http://creativebytes.co.za/blog/2009/07/25/im-back/</link>
		<comments>http://creativebytes.co.za/blog/2009/07/25/im-back/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 14:11:53 +0000</pubDate>
		<dc:creator>Geoff Garbers</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://creativebytes.co.za/blog/?p=51</guid>
		<description><![CDATA[So, after a little bit of a hiatus, I&#8217;m back. Been having a few issues with my hosting provider &#8211; turns out that when my hosting account was moved from the Kate server across to the Ilana server, my account somehow was lost.
A Small Orange were super-cool about it, and fixed everything within 2 hours [...]]]></description>
			<content:encoded><![CDATA[<p>So, after a little bit of a hiatus, I&#8217;m back. Been having a few issues with my hosting provider &#8211; turns out that when my hosting account was moved from the Kate server across to the Ilana server, my account somehow was lost.</p>
<p><a title="A Small Orange -- A great web hosting provider" href="http://asmallorange.com/">A Small Orange</a> were super-cool about it, and fixed everything within 2 hours of my having submitted a help ticket. I&#8217;d still recommend ASO &#8212; they really are awesome, and really &#8220;fiscally viable&#8221; (read: cheap).</p>
<p>Anyways, this was just a quick update to let you know that I&#8217;m back. I&#8217;m compiling a list of blog topics that I could post about (thanks for the idea, Tiaan), and when I get a moment to blog, I&#8217;ll share them with you <img src='http://creativebytes.co.za/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;m off to go watch the Springboks beat the All Blacks in the first Tri-Nations match, so hope you&#8217;re watching the match. &#8216;Til next time&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://creativebytes.co.za/blog/2009/07/25/im-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSIE doesn&#8217;t like filenames with numbers?</title>
		<link>http://creativebytes.co.za/blog/2009/06/09/msie-doesnt-like-filenames-with-numbers/</link>
		<comments>http://creativebytes.co.za/blog/2009/06/09/msie-doesnt-like-filenames-with-numbers/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 08:51:48 +0000</pubDate>
		<dc:creator>Geoff Garbers</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[msie]]></category>

		<guid isPermaLink="false">http://creativebytes.co.za/blog/?p=43</guid>
		<description><![CDATA[So, I was finishing up some of the final bugs on the Computicket website last night with one of the other developers in the office, Deon. One of the tweaks we needed to implement was the minifying of all the common JavaScript files on the website. Brilliant idea! We&#8217;ll just name the JavaScript file whatever [...]]]></description>
			<content:encoded><![CDATA[<p>So, I was finishing up some of the final bugs on the Computicket website last night with one of the other developers in the office, Deon. One of the tweaks we needed to implement was the minifying of all the common JavaScript files on the website. Brilliant idea! We&#8217;ll just name the JavaScript file whatever the current timestamp is &#8211; that should get around the caching issues with browsers caching the files with the same filename.</p>
<p><span id="more-43"></span> So, after naming the file (and the filename only contained numbers and a <em>.js</em> at the end), we tested it in Firefox. As most things do in Firefox, it worked. Then we tried it on &lt;shudder&gt;Internet Explorer&lt;/shudder&gt;. For some reason, no matter how we changed the JavaScript, it seemed to be throwing an error &#8211; but all the JavaScript was still seemed to be working just fine.</p>
<p>As a joke, I suggested we rename the file to start with a letter, instead of a number; and lo and behold, it worked in IE with no errors. And the only thing we changed was the filename!</p>
<p>I always knew IE was bizarre and implemented things weirdly, but <em>filenames</em>? Has anyone else ever come across similar behaviour to this? Would be really interested to know&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://creativebytes.co.za/blog/2009/06/09/msie-doesnt-like-filenames-with-numbers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Boldly venturing into new distros</title>
		<link>http://creativebytes.co.za/blog/2009/05/21/boldly-venturing-into-new-distros/</link>
		<comments>http://creativebytes.co.za/blog/2009/05/21/boldly-venturing-into-new-distros/#comments</comments>
		<pubDate>Thu, 21 May 2009 21:32:13 +0000</pubDate>
		<dc:creator>Geoff Garbers</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[operating systems]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://creativebytes.co.za/blog/?p=38</guid>
		<description><![CDATA[So, I&#8217;ve decided to migrate back from using my laptop at work, to using the desktop that was initially provided for me. The only difference is that I&#8217;ve now partitioned my hard-drive, and I&#8217;m running Linux alongside Windows. I figured that, considering I&#8217;m developing in PHP, I may as well use Linux, which what most [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve decided to migrate back from using my laptop at work, to using the desktop that was initially provided for me. The only difference is that I&#8217;ve now partitioned my hard-drive, and I&#8217;m running Linux alongside Windows. I figured that, considering I&#8217;m developing in PHP, I may as well use Linux, which what most servers running PHP use.</p>
<p>I made the jump to using Linux a little while ago on my laptop, and the distro I choose to move to was Ubuntu. I&#8217;ve only been using it properly for about four months, so by all accounts, I&#8217;m still a relative n00b when it comes to Linux.<span id="more-38"></span></p>
<p>Imagine my excitement when presented with the opportunity to gain extra geek points by installing Linux on a <em>second</em> computer! Imagine my disappointment, when presented with a display resolution that <em>refused</em> to go any higher than 960&#215;600.</p>
<p>Initially, I thought this was because I just needed to add the various modes into the xorg.conf file. However, this was not to be. No matter how hard I tried (and I even enlisted the services of the resident office Linux geek &#8211; <a title="Clifford W. Hansen -- Linux geek like no other" href="http://nighthawk.co.za/">Clifford</a>), I could not get the screen displaying the correct resolution. Frustration! Especially considering I <em>knew</em> that the resolutions I wanted were possible &#8211; after all, I managed to achieve them in Windows; and what 19&#8243; monitor <em>can&#8217;t</em> display a 1280&#215;1024 resolution!?</p>
<p>Fast forward about two hours, and Cliff suggested we try install Debian. So, we use the NetInstall disc that he had lying around, install the OS and the Gnome Desktop Manager (GDM). After logging in, we make a few edits to the xorg.conf; restart the GDM a few times; and as sure as Bob is <em>not</em> my auntie, I had a screen resolution of 1280&#215;1024. Heck, I could even push it up to 1600&#215;1200, which is something Windows <em>never</em> let me do!</p>
<p>So, I&#8217;m now cutting my teeth in two different distros. Not bad for a Linux n00b. I feel rather special, I do. Do you have any useful tips, tricks or applications that you find makes your Debian experience easier, and that you reckon this n00b could make use of?</p>
]]></content:encoded>
			<wfw:commentRss>http://creativebytes.co.za/blog/2009/05/21/boldly-venturing-into-new-distros/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reverse prefix routing in CakePHP</title>
		<link>http://creativebytes.co.za/blog/2009/05/08/reverse-prefix-routing-in-cakephp/</link>
		<comments>http://creativebytes.co.za/blog/2009/05/08/reverse-prefix-routing-in-cakephp/#comments</comments>
		<pubDate>Fri, 08 May 2009 08:18:08 +0000</pubDate>
		<dc:creator>Geoff Garbers</dc:creator>
				<category><![CDATA[CakePHP Development]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[customisation]]></category>
		<category><![CDATA[prefixes]]></category>
		<category><![CDATA[routing]]></category>

		<guid isPermaLink="false">http://creativebytes.co.za/blog/?p=10</guid>
		<description><![CDATA[After having worked on a particularly annoying problem involving the CakePHP custom prefix routing, I feel like I might have found a slight bug in the reverse routing (specifically, in a URL generated when calling Router::url()).
Let me set out a test scenario, so that I can fully explain what it is that I am trying [...]]]></description>
			<content:encoded><![CDATA[<p>After having worked on a particularly annoying problem involving the CakePHP custom prefix routing, I feel like I might have found a slight bug in the reverse routing (specifically, in a URL generated when calling <code>Router::url()</code>).<span id="more-10"></span></p>
<p>Let me set out a test scenario, so that I can fully explain what it is that I am trying to do. In this test scenario, we&#8217;ve got a bustling social networking site. But now, we want to WAP-enable this site &#8211; basically, we&#8217;re going to optimise it to be viewed on mobile phones. However, in order to keep the WAP section separate, we&#8217;re going to use a custom prefix, <strong>wap</strong>.</p>
<p>So, as an example URL, if a user wanted to log in to this mobile site, they would visit <strong>/wap/users/login</strong>, as opposed to <strong>/users/login</strong> on the main site. Additionally, when a user visits <strong>/wap</strong>, this is the exact same as visiting <strong>/wap/users/login</strong>.</p>
<p>So, we can now set up our first route that would fulfill this functionality:</p>
<pre class="brush: php">
Router::connect(&#039;/wap/&#039;, array(
&#039;controller&#039; =&gt; &#039;users&#039;,
&#039;action&#039; =&gt; &#039;login&#039;,
&#039;prefix&#039; =&gt; &#039;wap&#039;,
&#039;wap&#039; =&gt; true));
</pre>
<p>This works correctly. However, what happens if I want to link to that route from a hyperlink contained somewhere in the page? I supply an array for the URL portion of the <code>HtmlHelper::link()</code> method. So, you would think that using the following snippet of code, you would be provided with the correct URL:</p>
<pre class="brush: php">
echo $html-&gt;link(&#039;Foo&#039;, array(
&#039;controller&#039; =&gt; &#039;users&#039;,
&#039;action&#039; =&gt; &#039;login&#039;,
&#039;prefix&#039; =&gt; &#039;wap&#039;,
&#039;wap&#039; =&gt; true
));
</pre>
<p>However, this is, unfortunately, not the case. In my experience (using Cake version 1.2.1.8004), the actual output obtained is something more along the lines of <strong>/users/login/wap:1</strong> &#8211; so it seems as if the custom prefix is being ignored. However, I do believe I might have been able to pinpoint the bit of code in Cake that prevents the prepending of this prefix to the URL, as well as a possible solution that I&#8217;ve proposed.</p>
<p>The code that handles this part of the routing can be found around <strong>line 880</strong> in the Router core library definition:</p>
<pre class="brush: php">
$urlOut = Set::filter(array($url[&#039;controller&#039;], $url[&#039;action&#039;]));
</pre>
<p>Now, from what I can make out, this is creating the &#8220;front&#8221; part of the URL &#8211; the first two sections of the URL. Notice that only the controller and the action are taken into account. This means that the custom prefix can never actually come into play, and is always ignored. The following code snippet is my proposed solution to fix this:</p>
<pre class="brush: php">
if (empty($url[&#039;action&#039;])) {
if (empty($url[&#039;controller&#039;]) || $params[&#039;controller&#039;] === $url[&#039;controller&#039;]) {
$url[&#039;action&#039;] = $params[&#039;action&#039;];
} else {
$url[&#039;action&#039;] = &#039;index&#039;;
}
}
// start additions
$prefix = null;
if(isset($url[&#039;prefix&#039;]) &amp;amp;&amp;amp; isset($url[$url[&#039;prefix&#039;]]) &amp;amp;&amp;amp; $url[$url[&#039;prefix&#039;]] === true) {
$prefix = $url[&#039;prefix&#039;];
unset($url[$url[&#039;prefix&#039;]]);
} else {
$prefix = null;
}
// ... move down to about line 880
$urlOut = Set::filter(array($prefix, $url[&#039;controller&#039;], $url[&#039;action&#039;]));
// end additions
</pre>
<p>So, these are my findings and proposals. I&#8217;ve only recently made this change in my core libraries, but have yet to come across any issues brought on by this change. Do you have any suggestions or comments on this? If so, drop them in the comments.</p>
<p><strong>Edit:</strong> I&#8217;ve posted this same question in the CakePHP Google Groups. You can view it at <a title="http://groups.google.com/group/cake-php/browse_thread/thread/c9a40ee702bb7b89" href="http://groups.google.com/group/cake-php/browse_thread/thread/c9a40ee702bb7b89">http://groups.google.com/group/cake-php/browse_thread/thread/c9a40ee702bb7b89</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://creativebytes.co.za/blog/2009/05/08/reverse-prefix-routing-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hello, world!</title>
		<link>http://creativebytes.co.za/blog/2009/05/03/hello-world/</link>
		<comments>http://creativebytes.co.za/blog/2009/05/03/hello-world/#comments</comments>
		<pubDate>Sun, 03 May 2009 20:04:45 +0000</pubDate>
		<dc:creator>Geoff Garbers</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hello world]]></category>
		<category><![CDATA[introduction]]></category>
		<category><![CDATA[welcome]]></category>

		<guid isPermaLink="false">http://creativebytes.co.za/blog.wordpress/?p=3</guid>
		<description><![CDATA[Okay, so every blog has to have one of these. A first post. And as is customary for a development blog, what better title that &#8220;Hello, world!&#8221; &#8212; every new developer&#8217;s introductory text.
Well, after many months and/or years of always saying &#8220;I really should set up my blog,&#8221; I have finally done it. Of course, [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so every blog has to have one of these. A first post. And as is customary for a development blog, what better title that &#8220;Hello, world!&#8221; &#8212; every new developer&#8217;s introductory text.</p>
<p>Well, after many months and/or years of always saying &#8220;I really should set up my blog,&#8221; I have finally done it. Of course, it&#8217;s still very much in it&#8217;s infancy stages, and you&#8217;re going to need to look out for a number of improvements that will be coming your way.</p>
<p>Let me outline some of these changes (Bear with me here. By putting these down, I&#8217;m hoping to <em>actually</em> get to them within the next few months):</p>
<ol>
<li>Overhaul the Creative Bytes website, and make it more like a portfolio that I can be really proud of.</li>
<li>Update this blog to tie in with the website&#8217;s colour schemes and layout.</li>
<li>Get Employometer up and running (Making great progress with this, by the way. It&#8217;s taught me so much about CakePHP).</li>
</ol>
<p>And so, let me introduce myself (that is, if you don&#8217;t already know me). My name is Geoffrey Garbers, and I&#8217;m a PHP developer living and working in Cape Town, South Africa. Contrary to popular belief, we <em>do</em> have internet connectivity, and we <em>don&#8217;t</em> have elephants and lions roaming the streets (although, most of you are probably intelligent to know this).</p>
<p>My specializations lie in developing web and mobile sites, which I do whilst working at <a href="http://www.prezence.co.za/">Prezence New Media</a>. I can program in PHP, MySQL, JavaScript, X/HTML (not really programming languages, I know), and CSS. You could also throw in a smigdin of ASP.NET.</p>
<p>I primarily use <a href="http://cakephp.org/">CakePHP</a> as my framework of choice when developing. I&#8217;ve since moved on from <a href="http://codeigniter.com/">CodeIgniter</a>, which although it is a super awesome framework to use to learn the basics of the MVC design pattern, lacks the power that CakePHP offers.</p>
<p>So, now that you know me a bit better, how about you let me know some more about you? Hit me up in the comments &#8211; let me know who you are, what your website URL is, what your favourite colour is, and where you like to hang out (Just kidding about the last two &#8212; unless you really want to tell me).</p>
<p>Hey, and you can catch me on Twitter too: <a href="http://twitter.com/garbetjie">@garbetjie</a></p>
]]></content:encoded>
			<wfw:commentRss>http://creativebytes.co.za/blog/2009/05/03/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
