<?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>Anorgan's blog about stuff</title>
	<atom:link href="http://blog.anorgan.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.anorgan.com</link>
	<description>...hmm</description>
	<lastBuildDate>Sun, 07 Feb 2010 00:39:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Custom file input can&#8217;t be that hard?</title>
		<link>http://blog.anorgan.com/2010/02/07/custom-file-input-cant-be-that-hard/</link>
		<comments>http://blog.anorgan.com/2010/02/07/custom-file-input-cant-be-that-hard/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 00:07:10 +0000</pubDate>
		<dc:creator>Anorgan</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[browse button]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[input field]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.anorgan.com/?p=244</guid>
		<description><![CDATA[Ok, this is a quick post. I wanted to style the input for file upload, and spent some time fine tuning. In order to have this for future use, I made a tutorial for myself  . If you need to style file input, see my demonstration on how to fake file type input or [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, this is a quick post. I wanted to style the input for file upload, and spent some time fine tuning. In order to have this for future use, I made a tutorial for myself <img src='http://blog.anorgan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . If you need to style file input, see my demonstration on how to fake <a href="http://blog.anorgan.com/tutorials/fake_file_input.html">file type input</a> or download the file. This is in no way final or tested. If you have suggestions, please leave a comment.</p>
<blockquote><p><a class="download" title="Fake file input" href="/wp-content/uploads/2010/02/fake_file_input.zip"></a><a href="/wp-content/uploads/2010/02/fake_file_input.zip">Fake file input</a></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.anorgan.com/2010/02/07/custom-file-input-cant-be-that-hard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test projects viewer</title>
		<link>http://blog.anorgan.com/2009/04/05/test-projects-viewer/</link>
		<comments>http://blog.anorgan.com/2009/04/05/test-projects-viewer/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 21:58:14 +0000</pubDate>
		<dc:creator>Anorgan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[bind9]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[subdomain]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[wildcard]]></category>

		<guid isPermaLink="false">http://blog.anorgan.com/?p=202</guid>
		<description><![CDATA[I have a couple of test projects in my test directory. This is where I usually put the latest wordpress, phpBB or any other script or web software I would like to test out or develop and play with. Until recently I had to access those by writing the virtual host path (www.test.local) and then [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_217" class="wp-caption alignleft" style="width: 310px"><a class="thickbox" href="/wp-content/uploads/2009/04/test_environment.jpg"><img class="size-medium wp-image-217" title="Test environment viewer" src="http://blog.anorgan.com/wp-content/uploads/2009/04/test_environment-300x224.jpg" alt="Test environment viewer" width="300" height="224" /></a><p class="wp-caption-text">Test environment viewer</p></div>
<p>I have a couple of test projects in my test directory. This is where I usually put the latest wordpress, phpBB or any other script or web software I would like to test out or develop and play with. Until recently I had to access those by writing the virtual host path (www.test.local) and then append the directory name (in.eg. /drupal). I got tired of it, and coded a nifty little &#8220;browser&#8221; which displays all of the directories and files. Combined with the DNS wildcards, you can have unlimited virtual domains without having to configure them in vhosts, setting the /etc/hosts and restarting apache server. I have included this in the zip file found at the end of this post.</p>
<p>We are using bind dns server to resolve everything that comes to the &#8220;test&#8221; domain to your machines IP address. After that, Apache takes care of the rest. And what he does is kinda cool. The .htaccess file has a set of rules to test weather the index.php exists in the requested directory (via subdomain), and if it does, he redirects us to that directory. If the index.php doesn&#8217;t exist, our &#8220;main&#8221; index.php shows the contents of that directory, so you can select any other file and run it. Let&#8217;s start.</p>
<p><span id="more-202"></span>Setting up your DNS server under Ubuntu is best described <a title="Ubuntu DNS bind" href="http://rustykruffle.com/tech-stuff/ubuntu/how-i-got-networking-and-dns-to-work-in-ubuntu-intrepid/" target="_blank">here</a>. I will only display contents of my files, so you know what to do. My hostname (/etc/hostname) is &#8220;ubuntu&#8221; and IP address of my machine is 192.168.253, so when ever you see one of those, change to your settings. To install bind, use synaptic (search for bind9), to start, stop or restart bind, pass those commands to /etc/init.d/bind9, i.e. &#8220;/etc/init.d/bind9 stop&#8221;. To edit the files I used vi, and I also had to be root, so I ran sudo -i to become one.</p>
<p><strong>/etc/hosts</strong></p>
<blockquote><p><code> 192.168.1.253 ubuntu <br />
 192.168.1.253 www.test.local test.local </code></p>
</blockquote>
<p><strong>/etc/bind/named.conf.local</strong></p>
<blockquote><p><code>acl "local" { <br />
 192.168.1.0/24; <br />
 127.0.0.1; <br />
 };<br />
 zone "test" {<br />
 type master;<br />
 file "/etc/bind/zones/db.test";<br />
 allow-query { local; };<br />
 notify no;<br />
 };<br />
 // For reverse DNS <br />
 zone "1.168.192.in-addr.arpa" {<br />
 type master;<br />
 file "/etc/bind/zones/rev.1.168.192.in-addr.arpa";<br />
 allow-query { local; };<br />
 };</code></p>
</blockquote>
<p><strong>/etc/bind/named.conf.options</strong></p>
<blockquote><p><code><br />
 options {<br />
 directory "/var/cache/bind";<br />
 forwarders {<br />
 192.168.1.254;<br />
 };<br />
 auth-nxdomain no;    # conform to RFC1035<br />
 listen-on-v6 { any; };<br />
 };</code></p>
</blockquote>
<p><strong>/etc/bind/zones/db.test</strong></p>
<blockquote><p><code>$ORIGIN .<br />
 $TTL 86400      ; 1 day<br />
 test            IN SOA  test. (<br />
 200904031  ; serial number (todays date appnded with '1')<br />
 10800      ; refresh (3 hours)<br />
 3600       ; retry (1 hour)<br />
 604800     ; expire (1 week)<br />
 86400      ; minimum (1 day)<br />
 )<br />
 $ORIGIN test.<br />
 @                       NS      ubuntu<br />
 ubuntu                  A       192.168.1.253 ;This is the hostname &amp; ip of my computer<br />
 test                    CNAME   ubuntu<br />
 *.test                  CNAME   ubuntu</code></p>
</blockquote>
<p><strong>/etc/bind/zones/rev.1.168.192.in-addr.arpa</strong></p>
<blockquote><p><code>$ORIGIN .<br />
 $TTL 86400      ; 1 day<br />
 1.168.192.in-addr.arpa  IN SOA  test. (<br />
 200904031  ; serial number (today's date appended with '1')<br />
 28800      ; refresh (8 hours)<br />
 14400      ; retry (4 hours)<br />
 3024000    ; expire (5 weeks)<br />
 86400      ; minimum (1 day)<br />
 )<br />
 $ORIGIN 1.168.192.in-addr.arpa.<br />
 @       NS      ubuntu<br />
 253     PTR     ubuntu  ;The 253 is the last octet of my machines ip address</code></p>
</blockquote>
<p>After the bind has been set up, restart it, and test it. You should make a virtual host that points to www.test.test. Now, if you type anything else as subdomain, you should get the test.test page again. Try with something.test.test, or anythingelse.test.test.  For apache setup i have &#8220;NameVirtualHost 192.168.1.253&#8243; in the main config and use</p>
<blockquote><p><code><br />
 ServerName      test.test<br />
 ServerAlias     *.test.test<br />
 DocumentRoot    "/path/to/test"<br />
 </code></p>
</blockquote>
<p>for every subdomain i need.</p>
<p>We now have our environment set up, and need the contents of the test directory displayed. For that we use the index.php to list the directories and files. The directories are linked to be the subdomains. Now, if you do get to the directory which does not include index.php, it&#8217;s contents will be displayed, and you will be able to click the file you want to run. This is handled by .htaccess. If you type the wrong subdomain, you will get a notice about missing directory. I still didn&#8217;t get directories with uppercase letters or dots to display, but this is enough.</p>
<p>I also did a brief search for the theme, and used one to display the content, so it has the feeling of a finished project, not my usual html without the css or even parts of html without the html, head and body parts <img src='http://blog.anorgan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Somehow I couldn&#8217;t justify using smarty here <img src='http://blog.anorgan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , so i did str_replace to modify the content of the template. Here is the download link so you can put it in the /test dir and see all your projects. Tell me what you think of it.</p>
<blockquote><p><a  class="download" title="Test Environment" href="/wp-content/uploads/2009/04/test_environment.zip"></a><a href="/wp-content/uploads/2009/04/test_environment.zip">Test environment viewer</a></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.anorgan.com/2009/04/05/test-projects-viewer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I got the (mt) hosting</title>
		<link>http://blog.anorgan.com/2009/03/08/i-got-the-mt-hosting/</link>
		<comments>http://blog.anorgan.com/2009/03/08/i-got-the-mt-hosting/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 22:18:40 +0000</pubDate>
		<dc:creator>Anorgan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[(gs)]]></category>
		<category><![CDATA[(mt)]]></category>
		<category><![CDATA[Grid-service]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[mediatemple]]></category>

		<guid isPermaLink="false">http://blog.anorgan.com.s63292.gridserver.com/?p=157</guid>
		<description><![CDATA[I&#8217;ve seen a lot of hosting servers. Really a lot, I&#8217;m a developer. 99% of the time, they had cpanel, 99% of the time, one couldn&#8217;t optimize and setup his hosting place to meet his needs. That&#8217;s not because of the cpanel, of course, but because of the hosting company. My appetite for features and [...]]]></description>
			<content:encoded><![CDATA[<p><a title="(mt) mediatemple" href="http://www.mediatemple.net/" target="_blank"><img class="alignleft" title="(mt) mediatemple" src="http://www.mediatemple.net/_images/partnerlogos/mt-300x50-dk.jpg" alt="(mt) mediatemple" width="300" height="50" /></a>I&#8217;ve seen a lot of hosting servers. Really a lot, I&#8217;m a developer. 99% of the time, they had <a href="http://www.cpanel.net/" target="_blank">cpanel</a>, 99% of the time, one couldn&#8217;t optimize and setup his hosting place to meet his needs. That&#8217;s not because of the cpanel, of course, but because of the hosting company. My appetite for features and freedom of configuration got bigger over the years, so I got myself the  (gs) Grid-service hosting plan on Mediatemple. Upon sighting the /etc directory in my root, I got excited.</p>
<p><span id="more-157"></span>The account center is pretty clean an intuitive, although it took me a while make it feel at home after cpanel&#8217;s interface. Adding domains and sub-domains is easy, good thing is that the wild card domains are set up by default. PHP4 is turned on by default, one has to switch to PHP5 if he wants to &#8211; weird decision by mediatemple guys, but nothing to be alarmed by. You can set users for your whole grid service or only one domain, and ftp and ssh permissions are allowed per user. So, if you are reselling your (gs), your clients can have their email and ftp accounts separately, not knowing of the other sites you host. Nicely done, but I would opt for the (dv) Dedicated Virtual if you are serious about reselling.</p>
<p>I&#8217;ve setup my environment the way i want it and got subversion up and running. Setting the svn up is really easy and i encourage everyone to use it if they can. Saves the trouble of uploading over FTP and you always have the undo option at your fingertips. The server has ImageMagick installed, but sadly no ffmpeg or flvtool. Well, they have to justify buying the (dv) plan.</p>
<p>I still am not running any high traffic sites, so can&#8217;t comment on the GPU usage, but after setting up my <a title="HomeBudget" href="http://homebudget.anorgan.com/" target="_blank">HomeBudget</a>, blog and some other sites, I&#8217;ve spent 1 GPU. With 1000 GPU per month, i would conclude that it should be enough. I did a google search about mediatemples GPU usage, and some guys report they are burning 1000+ on their blogs (with claims of over 2000 page hits). Just to be safe, I&#8217;ll monitor my usage from time to time.</p>
<p>Anyway, this ffmpeg got me a bit upset, so I&#8217;m asking: what would you like to have on your hosting preinstalled? We&#8217;re talking about shared hosting.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.anorgan.com/2009/03/08/i-got-the-mt-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Not enough time</title>
		<link>http://blog.anorgan.com/2008/11/08/not-enough-time/</link>
		<comments>http://blog.anorgan.com/2008/11/08/not-enough-time/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 01:36:21 +0000</pubDate>
		<dc:creator>Anorgan</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.anorgan.com/blog/?p=151</guid>
		<description><![CDATA[5 or so years ago I wanted to make an audio amplifier. This year I finaly came around to doing that, only to be stopped, again, because of my schedule. We never have enough time. A day could have 48 hours, you&#8217;ll still be late for something, would forget to do some things you had [...]]]></description>
			<content:encoded><![CDATA[<p>5 or so years ago I wanted to make an audio amplifier. This year I finaly came around to doing that, only to be stopped, again, because of my schedule. We never have enough time. A day could have 48 hours, you&#8217;ll still be late for something, would forget to do some things you had to do. I don&#8217;t know. Where&#8217;s the catch? Do less?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.anorgan.com/2008/11/08/not-enough-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu + Palm = Something Completely Useless</title>
		<link>http://blog.anorgan.com/2008/07/20/ubuntu-palm-something-completely-useless/</link>
		<comments>http://blog.anorgan.com/2008/07/20/ubuntu-palm-something-completely-useless/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 18:27:23 +0000</pubDate>
		<dc:creator>Anorgan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[LCD]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[Palm]]></category>

		<guid isPermaLink="false">http://www.anorgan.com/blog/?p=99</guid>
		<description><![CDATA[
If you, like me, own a Palm III and also use Linux for your OS, then you are a complete geek. My excuse of owning a Palm is that my friend gave it to me, what&#8217;s yours? But that&#8217;s not the point of this post. The point of it is to show what ELSE is [...]]]></description>
			<content:encoded><![CDATA[<p><a class="thickbox" href="/wp-content/uploads/2008/07/_7205264.jpg"></a></p>
<div id="attachment_100" class="wp-caption alignleft" style="width: 310px"><a class="thickbox" href="http://blog.anorgan.com/wp-content/uploads/2008/07/_7205264.jpg"><img class="size-medium wp-image-100" title="Palm showing my CPU usage" src="http://blog.anorgan.com/wp-content/uploads/2008/07/_7205264-300x237.jpg" alt="Palm showing my CPU usage" width="300" height="237" /></a><p class="wp-caption-text">Palm showing my CPU usage</p></div>
<p>If you, like me, own a Palm III and also use Linux for your OS, then you are a complete geek. My excuse of owning a Palm is that my friend gave it to me, what&#8217;s yours? But that&#8217;s not the point of this post. The point of it is to show what ELSE is Palm good for. It is hard to take notes, people look at you as a complete stranger, you can&#8217;t connect it to the internet (it&#8217;s Palm IIIc we&#8217;re talking about), there&#8217;s no GPS, so what&#8217;s it good for? Well, let&#8217;s assume you have a program and want to see the CPU and memory usage while you <span style="text-decoration: line-through;">play</span> use your program. One way to do that is to load System Monitor. But that&#8217;s not geeky enough. No, that&#8217;s for people who still have a life, not to mention a girlfriend. For us, über-geeks, with no life, external display is the way to go. And Palm is a really good looking external display <img src='http://blog.anorgan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Let&#8217;s start.</p>
<p><span id="more-99"></span></p>
<h1>Things you need:</h1>
<ol>
<li>Palm (I have Palm IIIc, you can use some other Palm, or even an LCD system)</li>
<li>Linux <img src='http://blog.anorgan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Program for Palm to emulate the LCD display. I used PalmOrb (<a href="http://palmorb.sourceforge.net/" target="_blank">http://palmorb.sourceforge.net/</a>)</li>
<li>Program for displaying system information from your Linux on a LCD. I used LCDproc (<a href="http://lcdproc.org/" target="_blank">http://lcdproc.org/</a>)</li>
</ol>
<h1>Procedure for deleting your life</h1>
<p>First you have to be able to connect your Palm to your ttyS0 (that&#8217;s serial port). If it&#8217;s not ttyS0, than its one of the above ports (S1, S2, &#8230;). For other purposes it is recommended to have /dev/palm as device so do:</p>
<p><code>sudo ln -s /dev/ttyS0 /dev/palm</code></p>
<p>This links ttyS0 to “virtual” palm device.</p>
<h2>Installing and patching LCDproc</h2>
<p>Install LCDproc via synaptic. Download (don&#8217;t install) LCDproc and edit server/drivers/MtxOrb.c file, uncomment the line “memset(p-&gt;backingstore, 0xFE, (p-&gt;width * p-&gt;height));” in MtxOrb_clear. Compile it. In terminal, while in the directory, type:</p>
<p><code>./configure<br />
 make</code></p>
<p>Now, replace the compiled MtxOrb.so in /usr/lib/lcdproc with this one in server/drivers (cp server/drivers/MtxOrb.so /usr/lib/lcdproc/MtxOrb.so). Ok, you have installed the LCDproc and patched it.</p>
<h2>Configuration</h2>
<p>Configure the LCDd.conf in /etc and edit the following:</p>
<p><em>in [server] section edit:</em></p>
<p><code>Driver=MtxOrb<br />
 DriverPath=/usr/lib/lcdproc/</code></p>
<p><em>in [MtxORB] section edit:</em></p>
<p><code>Device=/dev/pilot<br />
 Size=20x4<br />
 Type=lkd<br />
 Speed=19200</code></p>
<h2>Starting up</h2>
<p>On your connected Palm, start PalmOrb. Start LCD deamon:</p>
<p><code>/etc/init.d/LCDd start</code></p>
<p>Initiate the deamon to start showing status on the LCD:</p>
<p><code>lcdproc</code></p>
<p>Now you should have your system information on you Palm. There are differences for some distros, but you should know how to change the settings for your system, and if you have USB connection, this <a href="http://web.aanet.com.au/~auric/?q=node/10" target="_blank">post</a> shows the settings for USB. Ok, that&#8217;s it. You are officially a member of have-no-life people!<a href="http://www.anorgan.com/blog/wp-content/uploads/2008/07/_7205264.jpg"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.anorgan.com/2008/07/20/ubuntu-palm-something-completely-useless/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How I Learned to Stop using Windows and Love the Linux</title>
		<link>http://blog.anorgan.com/2008/07/03/how-i-learned-to-stop-using-windows-and-love-the-linux/</link>
		<comments>http://blog.anorgan.com/2008/07/03/how-i-learned-to-stop-using-windows-and-love-the-linux/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 21:25:24 +0000</pubDate>
		<dc:creator>Anorgan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.anorgan.com/blog/?p=88</guid>
		<description><![CDATA[AT THE BEGINNING: WINDOWS
Ok, not windows, I have used DOS 6.2, great OS. Move to dir, type command, play game. That&#8217;s it. Then installed Win 3.1. Lol. Nice windows. Now what? Windows 95 came out, and I thought “Great, now we&#8217;ll have the abilities of DOS and nice interface of Windows”. Errrr. Soon the 98 [...]]]></description>
			<content:encoded><![CDATA[<h1>AT THE BEGINNING: WINDOWS</h1>
<p>Ok, not windows, I have used DOS 6.2, great OS. Move to dir, type command, play game. That&#8217;s it. Then installed Win 3.1. Lol. Nice windows. Now what? Windows 95 came out, and I thought “Great, now we&#8217;ll have the abilities of DOS and nice interface of Windows”. Errrr. Soon the 98 came out, and the ME. Nope, not there yet. With XP things changed. It worked, was stable (kinda), but ever so often, I had to reinstall my system. Then Vista came out, and after installing it, I was content. Not all programs worked, but that&#8217;s normal. I hoped for it to be more compatible, more lightweight.</p>
<p>Past month I decided to let go of the MS operating systems, and go for Linux. Linux always intrigued me. I downloaded my first “flawor”, Red Hat 9, a couple of years ago. Downloaded, burned, installed. Didn&#8217;t recognize all my hardware, installing new software was a pain in the ass, and finding good software that was alternative to windows platform was hard. I learned to compile stuff, search for dependencies, uninstall, this, that, but that was not something a normal kid would go for. No games. Sorry. Fedora came out. Ok, nice. A couple more encounters with Linux (System rescue cd was a good find) couldn&#8217;t convince me to turn over to open-source. Well, Microsoft did. Vista is just too hungry for RAM. And I don&#8217;t wanna buy more RAM. I think 1 gig is enough (if you&#8217;re not gaming). The latest <a href="http://www.ubuntu.com/" target="_blank">Ubuntu</a> was downloaded, burned and ready for install.</p>
<p><span id="more-88"></span></p>
<h1>LINUX</h1>
<p>I did a backup of the system partition, formated the drive (well, actually Ubuntu did that) and installed the famous Linux distribution. Everything went well, but the GRUB didn&#8217;t want to install. One test with  System rescue disk and it&#8217;s testdisk showed the partitions, and after rewriting the partition table (oh, yes, windows fucked it up) everything was fine. The amount of time it took me to setup my system was surprising. All the necessary programs were installed, and the rest that were missing were easy to install: open up synaptic, search for software, click apply. That&#8217;s it. No restart, no going through pointless wizzard, no questions like “Are you sure u want to install?”, and so on. As I&#8217;m developing web sites, I installed the necessary server applications like apache web server, php, mysql with 3 clicks. Went to synaptic, selected the web server package, clicked apply. After the setup of the virtual servers, and configuration of the databases, I was able to access my sites. This all can literally be done in about an hour.</p>
<h1>STABILITY</h1>
<p>Using compiz fusion, cairo-dock, pidgin, indexer, Thunderbird that is always active on my desktop nr.2, and all the rest of services/demons that are active, plus OpenOffice Writer, the system monitor shows 327 mb ram in use and 20% CPU. Oh, remembered about apache server with MySql. Try that in windows. Compiz can sometime render the windows black. Then I go to reload window manager, and everything is fine again. Not nice, but maybe a bug that will be corrected in the future. No crashes so far (I managed to crash it once, when running Photoshop CS2 using <a href="http://www.codeweavers.com/products/cxlinux/" target="_blank">crossover linux</a>, but no problems  after that).</p>
<h1>GAMES</h1>
<p>Well, this is more of a problem with the industry than with the Linux, there are not a lot of games natively supporting Linux. You can run Unreal, and a couple of others. With Wine/Crossover linux, you can run windows games, like WOW.</p>
<h1>WORKFLOW</h1>
<p>A LOT better. Everything is fast, programs load fast, compiz is not only eye-candy, it helps with using the OS. The restarting of the PC after installing some programs is history. You DO need to use the console for advanced stuff, but in during “normal” work terminal is unnecessary.</p>
<h1>CONCLUSION</h1>
<p>It still is a bit early for me to make a good conclusion, but so far i have no bigger objections. My girlfriend uses my PC often to check her CDs, browse the web and the like. She almost didn&#8217;t notice it was completely different OS. I&#8217;ll try to update this post after a certain period of time, when I&#8217;ll have more experience.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.anorgan.com/2008/07/03/how-i-learned-to-stop-using-windows-and-love-the-linux/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PHP and template engines (and some other stuff)</title>
		<link>http://blog.anorgan.com/2008/06/28/php-and-template-engines-and-some-other-stuff/</link>
		<comments>http://blog.anorgan.com/2008/06/28/php-and-template-engines-and-some-other-stuff/#comments</comments>
		<pubDate>Sat, 28 Jun 2008 15:19:52 +0000</pubDate>
		<dc:creator>Anorgan</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[smarty]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.anorgan.com/blog/?p=23</guid>
		<description><![CDATA[I’m developing web sites for quite some time now, started when i was… Young? Yellow? Well, started a long time a go in a galaxy… AARGH! Can’t get Star Wars out of my life! Anyway. In the beginning i was using the good old php mess approach:
echo '&#60;ul&#62;';
 foreach($array as $item) {
 echo '&#60;li&#62;Some $item [...]]]></description>
			<content:encoded><![CDATA[<p>I’m developing web sites for quite some time now, started when i was… Young? Yellow? Well, started a long time a go in a galaxy… AARGH! Can’t get Star Wars out of my life! Anyway. In the beginning i was using the good old php mess approach:</p>
<p><code>echo '&lt;ul&gt;';<br />
 foreach($array as $item) {<br />
 echo '&lt;li&gt;Some $item here&lt;/li&gt;';<br />
 }<br />
 echo '&lt;ul&gt;';<br />
 </code></p>
<p>And so on. For onepagers this was enough. So i stumbled accross <a href="http://mambo-foundation.org/" target="_blank">mambo</a> (former <a href="http://www.joomla.org/" target="_blank">Joomla</a>) and saw the raw power of cms and, well for me, good coding. K, let&#8217;s make ourselves a content management system. But how? What do we need? The neccesary ingridients where these:</p>
<ul>
<li><a href="http://www.apache.org/" target="_blank">Apache</a> with <a href="http://www.php.net/" target="_blank">php</a> (obvious)</li>
<li><a href="http://www.mysql.com/" target="_blank">MySQL</a> database (oh, what&#8217;s this database thing for?)</li>
<li>foresight</li>
</ul>
<p>What’s the most important? No, wrong, not coffee. Foresight! Without analyzing and planning the outcome can’t be good. I started to code. Heavily. Took a good number of different approaches, all ended bit dull and like they couldn’t take on serious tasks.</p>
<p><span id="more-23"></span></p>
<p>Why this intro? So you can better relate to me. I AM one of you, coders. We all started like this. One learns trough he’s own mistakes. What have I learned? Let’s take this a bit further. There is no good CMS without know-how, so these are the things one has to be familiar with:</p>
<ul>
<li>apache web server and its .htaccess or http.conf files and configurations. Hence the readable links, good caching, security…</li>
<li><a href="http://www.ubuntu.com/" target="_blank">Linux</a>, yes, you need a bit of knowledge of that OS and it&#8217;s abilities. Good start is to install it on an empty partition or run it virtualized with <a href="http://www.vmware.com/" target="_blank">VMWare</a>. When you get to know it, you can do marvels like putting a cache directory into system memory with tmpfs, and so on</li>
<li>php programming language, with good knowledge of object oriented programming (OOP). This just simplifies things, realy. </li>
<li> usage of a template engine (oh, we&#8217;re getting on to a topic here, let&#8217;s have a beer!). I prefer <a href="http://www.smarty.net/" target="_blank">Smarty</a>, some say it&#8217;s too big, too complicated, too **insert your reason here**. I found that I can do my sites faster with it, so i use it</li>
<li>mysql database. This could be the hardest and most time consuming, but it&#8217;s well worth it. It includes database designing and SQL programming</li>
<li>benchmarking and debugging is also a part of the process. I use bit of <a href="http://xdebug.org/" target="_blank">xdebug</a>, <a href="http://www.zend.com/" target="_blank">zend platform</a>, smarty debug console, my own debug console for page creation time and sql execution times</li>
</ul>
<p>Ok, this is a handful, but any of the above items should be tackled at some point of the learning curve. If we are trying to code and produce scalable sites that can do the task right, we should be familiar with the MVC architecture. It comes down to having a database to store our data, php code to process that data and template to show that data. The upper code with all this in mind would be:</p>
<h2>DATABASE:</h2>
<p>1. item 1<br />
 2. item 2<br />
 3. item 3<br />
 4. &#8230;</p>
<h2>PHP and SQL:</h2>
<p><code>$data = $db-&gt;fetch('SELECT item FROM table');<br />
 $t-&gt;assign('data', $data);</code></p>
<h2>TEMPLATE:</h2>
<p><code>&lt;h1&gt;Our items&lt;/h1&gt;&lt;ul&gt;<br />
 {section name=item loop=$data}&lt;li&gt;{$data[item]}&lt;/li&gt;<br />
 {/section}&lt;/ul&gt;</code></p>
<p>Here we use a database abstraction layer class ($db) and are free of repeating the same change accross our code should we change database, etc. The template is free for editing by the designer, and the coder can still work on his code. Now we have everything separated, and one process can be changed regardless of the other.</p>
<p>One question pops up when we see {section}. It’s smarties way of saying “loop array $data and present data in the following way”. So, why should our designer be bothered with foreaches and if-then-elses? Answer lies in the following lines:</p>
<p><code>{section name=item loop=$data}<br />
 &lt;li {if $smarty.section.item.first}class="first"{/if}&gt;{$data[item]|upper}&lt;/li&gt;<br />
 {/section}</code></p>
<p>Designer just realized that the data presented is not right. Items should be uppercase and the first &lt;li&gt; should have class=”first”. Instead of yelling to the programmer “give me uppercased items!!!”, the designer has the power to modify, mold the data. Php guy is working on the control segment as we speak, he is half through the form processing code, which takes the order or whatnot, and the designer is at liberty to change the appearance of the data. He will choose to truncate long text, format date to display only day and month, maybe put {sectionelse} No data to display {/section} if $data array is empty, and he will never need to bother the programmer for those tasks.</p>
<p>If the caching is turned on, the php code and database calls will never even be executed, because the content is already rendered in some static file (which resides in our cache directory happily mounted to memory with tmpfs)</p>
<p>As we can see, this architecture helps alot, but it can be moved further. What if you need to present this data a couple of times across your site? It would be good if we could somehow include this block anytime we need it. And so we can, with {include file=”items.tpl”}. Anywhere we need this data (on the homepage, in the cart…) we just include this bit of a line. Saves time, eh? Now for the bad part.</p>
<h1>Drawbacks</h1>
<p>Template engines are good things to have, but they slow execution of the page. Smarty renders php code out of the template, and for that needs some processing time. He renders only once, and the rendered template benefits from the usage of some opcode cache module like <a href="http://eaccelerator.net/" target="_blank">eAccellerator</a>, <a href="http://www.zend.com/en/products/guard/optimizer/" target="_blank">Zend Optimizer</a> and such.</p>
<p>There is also the need to learn new language, smarty’s template language. It’s not that hard, and there is a lot of <a href="http://www.smarty.net/manual/en/" target="_blank">documentation</a> on the net for it. When you get accustomed to your template engines language, and start coding, the html starts to look really ugly. That’s really up to you to decide weather you want to have all the foreaches and if/then/elses in the php, parse them, and send them to the template. There is also <a href="http://phptal.motion-twin.com/" target="_blank">PHPTal</a> template engine, whose code is really simple and intuitive.</p>
<h1>Conclusion</h1>
<p>Once you take the MVC road, there is no turning back. You will never go back to having all the code and html in one file. Your next stop is maybe using some frameworks to get the job done even faster (<a href="http://www.symfony-project.org/" target="_blank">symfony</a>, <a href="http://www.akelos.org/" target="_blank">akelos</a>, <a href="http://framework.zend.com/" target="_blank">zend framework</a>&#8230;), or building your own classes for your application.</p>
<p>Keep coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.anorgan.com/2008/06/28/php-and-template-engines-and-some-other-stuff/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress SVN upgrade</title>
		<link>http://blog.anorgan.com/2008/06/08/wordpress-svn-upgrade/</link>
		<comments>http://blog.anorgan.com/2008/06/08/wordpress-svn-upgrade/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 16:28:46 +0000</pubDate>
		<dc:creator>Anorgan</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[plug-in]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.blog.local/?p=5</guid>
		<description><![CDATA[Usually when the new version of WordPress is out, you have to download the latest zip (or tar.gz), unpack it, upload everything, and run upgrade. You can help yourself with uploading the zip file to the server and unpack it there, but you have to have shell account and know a bit of console commands.
There [...]]]></description>
			<content:encoded><![CDATA[<p>Usually when the new version of WordPress is out, you have to download the latest zip (or tar.gz), unpack it, upload everything, and run upgrade. You can help yourself with uploading the zip file to the server and unpack it there, but you have to have shell account and know a bit of console commands.</p>
<p>There is another way of upgrading to the latest version, and that involves usage of <a title="Subversion" href="http://subversion.tigris.org/" target="_blank">Subversion</a>. This gets the latest of files but you still need the console. The command is:</p>
<p><code>svn co http://svn.automattic.com/wordpress/trunk/</code></p>
<p>So, to help with the upgrading process, I&#8217;ve developed the SVN upgrade plug-in. It uses the phpSVNclient and some other classes by <a href="http://www.sixdegrees.com.br" target="_blank">Cesar</a>, who posted it on <a href="http://www.phpclasses.org/" target="_blank">PHP Classes</a>. I took it and made the plug-in firstly for my CMS, and it works great. Than I saw that the WordPress can be obtained via Subversion, so I decided to make svn upgrade available to all.</p>
<p>SVN upgrade uses database (wp_svn table) in which it stores the latest repository revision. If a new revision is out, you can do the upgrade, otherwise it will tell you that it is on the latest version.</p>
<p>Oh, and I have just tested it, again. 8061 is out! Bleeding edge! wp-login.php just got debugged, or something, and i have it! With just one click! Great!</p>
<p><span id="more-6"></span></p>
<p>Anyway, the plug-in can be downloaded here:<a href="/wp-content/uploads/2008/06/wp-svn.zip"> SVN upgrade plug-in</a></p>
<p>Installation is easy as always:</p>
<ol>
<li>Unpack and upload to wp-content/plugins</li>
<li>Install via admin console (plugins page)</li>
<li>If necessary update the repository in settings section</li>
<li>Go to the SVN upgrade page (link in main menu) and click SVN upgrade</li>
</ol>
<p>That&#8217;s it. Happy upgrading!</p>
<blockquote><p>Update: no need for this plugin anymore, the new WordPress handles updates on his own <img src='http://blog.anorgan.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  .</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.anorgan.com/2008/06/08/wordpress-svn-upgrade/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
