<?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>Rob Allen&#039;s DevNotes &#187; Software</title>
	<atom:link href="http://akrabat.com/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://akrabat.com</link>
	<description>Developing PHP software in the Real World, by Rob Allen</description>
	<lastBuildDate>Wed, 01 Sep 2010 14:33:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>The watch Linux command line tool</title>
		<link>http://akrabat.com/software/the-watch-linux-command-line-tool/</link>
		<comments>http://akrabat.com/software/the-watch-linux-command-line-tool/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 07:42:34 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=706</guid>
		<description><![CDATA[I'm sure everyone else already knows about watch, but it's new to me. This little utility executes a program repeatedly at a set interval and displays its output. I've been using it with mysqladmin's processlist command like this: watch&#160;-n&#160;1&#160;/usr/bin/mysqladmin&#160;-uroot&#160;-pMYPASSWORD&#160;&#160;processlist Note that this does put your password on display at the top of the command window [...]]]></description>
			<content:encoded><![CDATA[<p>I'm sure everyone else already knows about <tt>watch</tt>, but it's new to me. This little utility executes a program repeatedly at a set interval and displays its output.</p>
<p>I've been using it with <tt>mysqladmin</tt>'s <tt>processlist</tt> command like this:</p>
<pre class="phpcode"><span style="color: #0000BB">
watch&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">n&nbsp;1&nbsp;</span><span style="color: #007700">/</span><span style="color: #0000BB">usr</span><span style="color: #007700">/</span><span style="color: #0000BB">bin</span><span style="color: #007700">/</span><span style="color: #0000BB">mysqladmin&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">uroot&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">pMYPASSWORD&nbsp;&nbsp;processlist
</span>
</span></code></pre>
<p>Note that this does put your password on display at the top of the command window whilst <tt>watch</tt> is running. If you don't want that, you could write a little bash script instead like this one from a friend of mine:</p>
<pre class="phpcode"><span style="color: #0000BB">
</span><span style="color: #FF8000">#!/bin/sh

</span><span style="color: #007700">while&nbsp;:
do
</span><span style="color: #0000BB">sleep&nbsp;1
clear
mysqladmin&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">uroot&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">pMYPASSWORD&nbsp;processlist&nbsp;
done
</span>
</span></code></pre>
<p>Either way, we get a display of the MySQL process list every second in a Terminal window and it becomes very easy to see which processes are causing trouble.</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/software/the-watch-linux-command-line-tool/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Setting up PHP on OS X Leopard</title>
		<link>http://akrabat.com/php/setting-up-php-on-os-x-leopard/</link>
		<comments>http://akrabat.com/php/setting-up-php-on-os-x-leopard/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 22:07:45 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=401</guid>
		<description><![CDATA[In the vein of some of Lorna's articles, this is more a note for myself than anything else. Not everything is explained in detail as it assumes you know how to use a command line... These are the steps I take to get the Apple supplied PHP working with GD, PDO_MySQL and Xdebug working on [...]]]></description>
			<content:encoded><![CDATA[<p>In the vein of some of <a href="http://www.lornajane.net/">Lorna</a>'s articles, this is more a note for myself than anything else. Not everything is explained in detail as it assumes you know how to use a command line...</p>
<p>These are the steps I take to get the Apple supplied PHP working with GD, PDO_MySQL and Xdebug working on OS X 10.5.</p>
<h3>/usr/local</h3>
<p>Ensure that the following directories exist:</p>
<pre>
    sudo mkdir /usr/local/include
    sudo mkdir /usr/local/bin
    sudo mkdir /usr/local/lib
    sudo mkdir -p /usr/local/man/man1
</pre>
<h3>Run Apache in 32 bit mode</h3>
<p>This saves us having to compile our own MySQL as MySQL doesn't offer a "fat" binary</p>
<ol>
<li><tt>cd /System/Library/LaunchDaemons</tt></li>
<li><tt>sudo vim org.apache.httpd.plist</tt></li>
<li>Immediately <em>after</em> the line containing <tt>&lt;array&gt;</tt> add:
<pre>
    &lt;string&gt;arch&lt;/string&gt;
    &lt;string&gt;-i386&lt;/string&gt;
</pre>
</li>
<li>Reboot</li>
</ol>
<h3>MySQL</h3>
<ol>
<li>Download the 32bit version of MySQL 5.0.x for OS X 10.5 from mysql.com and install the pkg, the startup item and the pref pane.</li>
<li>Add <tt>/usr/local/mysql/bin</tt> to the path: <tt>vim ~/.bash_profile</tt> and add:
<pre>
    export PATH=~/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH
    export EDITOR=vim
</pre>
<p> at top of file. (Note that we set EDITOR whilst we are here so that svn is happy!)
</li>
<li>Set up MySQL root password:
<pre>
    mysqladmin -u root password {new-password}
    mysqladmin -u root -p{new-password} -h localhost password {new-password}
    mysqladmin -u root -p reload
</pre>
<p>Quit Terminal to flush the history to file. Restart Terminal and remove the history file: <tt>rm .bash_history</tt> so that {new-password} isn't in plain text on the disk.
</li>
<li>Set the correct socket information for PHP. Ensure MySQL is running via the System Preferences panel then:
<pre>    sudo mkdir /var/mysql
    sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
</pre>
</li>
</ol>
<h3>Rest of Apache setup</h3>
<ol>
<li><tt>cd /etc/apache2</tt></li>
<li><tt>sudo vim httpd.conf</tt></li>
<li>Find <tt>#LoadModule php5_module        libexec/apache2/libphp5.so</tt> and remove the leading <tt>#</tt></li>
<li>Find <tt>AllowOverride None</tt> within the <tt>&lt;Directory "/Library/WebServer/Documents"&gt;</tt>section and change to<tt>AllowOverride All</tt> so that .htaccess files will work.</li>
<li>Restart Apache: <tt>sudo apachectl restart</tt></li>
<li>Open Finder and navigate to <tt>/Library/WebServer/Documents/</tt></li>
<li>Create a new folder called "orig" and place all files currently in the Documents folder into it.</li>
<li>Create a new file called info.php with <tt>&lt;?php phpinfo();</tt> inside it.
</li>
<li>Use Safari to navigate to http://localhost/info.php and check that the PHP version is displayed (5.2.6 at the time of writing).</li>
</ol>
<h3>php.ini</h3>
<ol>
<li><tt>cd /etc</tt></li>
<li><tt>sudo cp php.ini.default php.ini</tt></li>
<li><tt>sudo chmod ug+w php.ini</tt></li>
<li><tt>sudo chgrp admin php.ini</tt></li>
<li><tt>vim php.ini</tt> (assuming your user is a member of the admin group) and change settings appropriately. Change:
<pre>
    error_reporting  =  E_ALL | E_STRICT
    extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20060613"
</pre>
<p>You must set the extension dir correctly. (Commenting the line out also works...)
</li>
</ol>
<h3>PHP extensions</h3>
<p>The supplied PHP doesn't come with pdo_mysql, pear or gd, so fix it.</p>
<ol>
<li>Download the correct version of PHP from <a href="http://www.php.net/releases/">http://www.php.net/releases/</a>. (5.2.6 at time of writing)</li>
<li>Create a directory called src in your home directory and unpack the PHP source. This creates /Users/rob/src/php-5.2.6/ in my case.</li>
</ol>
<h4>pdo_mysql</h4>
<ol>
<li><tt>cd ~/src/php-5.2.6/ext/pdo_mysql</tt>.</li>
<li><tt>phpize</tt></li>
<li><tt>MACOSX_DEPLOYMENT_TARGET=10.5 \<br />
CFLAGS='-O3 -fno-common -arch i386' \<br />
LDFLAGS='-O3 -arch i386' \<br />
CXXFLAGS='-O3 -fno-common -arch i386' \<br />
./configure --prefix=/usr --with-pdo-mysql=/usr/local/mysql</tt></li>
<li><tt>make</tt></li>
<li><tt>sudo make install</tt></li>
<li>Edit <tt>/etc/php.ini</tt> and find the <tt>extension_dir</tt> line and add after it:
<pre>    extension=mysql.so</pre>
</li>
<li>Restart apache: <tt>sudo apachectl restart</tt> and check in the phpinfo that pdo_mysql is now loaded.</li>
</ol>
<h4>GD</h4>
<p>Installing GD onto the stock PHP install that is supplied with OS X is slightly more complicated than you'd expect because you need to install libjpeg first.</p>
<p><strong>Libjpeg</strong></p>
<p>Libjpeg is available from the <a href="http://www.ijg.org/">Independent JPEG Group</a>.</p>
<ol>
<li>Download the source code: <a href="http://www.ijg.org/files/jpegsrc.v6b.tar.gz">http://www.ijg.org/files/jpegsrc.v6b.tar.gz</a></li>
<li>extract to ~/src</li>
<li><tt>cd ~/src/jpeg-6b</tt></li>
<li><tt>cp /usr/share/libtool/config.* .</tt></li>
<li><tt>./configure --enable-shared</tt></li>
<li><tt>sudo make install</tt></li>
<li>Libjpeg is now installed in /usr/local/lib</li>
</ol>
<p><strong>GD extension</strong></p>
<ol>
<li><tt>cd ~/src/php-5.2.6/ext/gd</tt></li>
<li><tt>phpize</tt></li>
<li><tt>MACOSX_DEPLOYMENT_TARGET=10.5 \<br />
CFLAGS='-O3 -fno-common -arch i386' \<br />
LDFLAGS='-O3 -arch i386' \<br />
CXXFLAGS='-O3 -fno-common -arch i386' \<br />
./configure --with-zlib-dir=/usr --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-freetype-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6</tt></li>
<li><tt>make</tt></li>
<li><tt>sudo make install</tt></li>
<li>Edit <tt>/etc/php.ini</tt> and find the <tt>extension_dir</tt> line and add after it:
<pre>    extension=gd.so</pre>
</li>
<li>Restart apache: <tt>sudo apachectl restart</tt> and check in the phpinfo that GD is now loaded.</li>
</ol>
<h3>PEAR</h3>
<ol>
<li><tt>cd ~/src/</tt>.</li>
<li><tt>curl http://pear.php.net/go-pear > go-pear.php</tt></li>
<li>Accept defaults, except for installation prefix (1) should be <tt>/usr/local</tt></li>
<li>Check that the <tt>include_path</tt> in <tt>/etc/php.ini</tt> is correct and includes the PEAR directory (/usr/local/PEAR).</li>
</ol>
<h3>Xdebug</h3>
<p>Can't have a PHP development environment without <a href="http://www.xdebug.org/">xdebug</a>!</p>
<ol>
<li><tt>sudo pecl install xdebug</tt></li>
<li>Edit /etc/php.ini and add
<pre>    zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"</pre>
<p> after the other extension lines.</li>
<li>Restart apache: <tt>sudo apachectl restart</tt> and check in the phpinfo that xdebug is now loaded.</li>
</ol>
<h3>PHPUnit</h3>
<ol>
<li><tt>sudo pear channel-discover pear.phpunit.de</tt></li>
<li><tt>sudo pear install phpunit/PHPUnit</tt></li>
</ol>
<p>It all works on this machines, anyway :)</p>
<p><strong>Update</strong>see <a href="http://www.entropy.ch/blog/Software/2009/03/27/PHP-5-2-9-and-5-3-0RC1-Packages-for-Mac-OS-X-10-5.html">Marc Liyanage's PHP5 packages</a></p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/php/setting-up-php-on-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>TaskPaper</title>
		<link>http://akrabat.com/software/taskpaper/</link>
		<comments>http://akrabat.com/software/taskpaper/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 16:40:49 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://akrabat.com/2007/11/18/taskpaper/</guid>
		<description><![CDATA[One of the apps that I've found that I'm using daily is TaskPaper from Hog Bay Software. It's a brilliantly simple idea where all it does is format up a standard text file to make it easier to use as a todo list. You just start each item with a dash and it will automatically [...]]]></description>
			<content:encoded><![CDATA[<p>One of the apps that I've found that I'm using daily is <a href="http://hogbaysoftware.com/products/taskpaper">TaskPaper</a> from Hog Bay Software. It's a brilliantly simple idea where all it does is format up a standard text file to make it easier to use as a todo list.</p>
<p>You just start each item with a dash and it will automatically provide a checkbox next to the item. When you tick the checkbox, then a tag, @done, is added to the end of the line and it is crossed out. To aid organisation, any title that ends in a colon is automatically made bold and considered a project. Tags start with a @ symbol and can be used for filtering.  For instance, you can get it to display all tasks with the tag of @town to provide a list of items to be done when you next go into town. </p>
<p>All in all, TaskPaper is very simple and very easy to use. You start it up and you can get going straight away.</p>
<p>Obviously, there are a few niggles! Three that I've noticed are:</p>
<ul>
<li>Dragging and dropping of tasks to reorder isn't as smooth as it could be as TaskPaper tends to put the task you are moving into the same line as the task you are trying to insert above.</li>
<li>If I've completed all sub-tasks, it would be nice if it automatically marked the parent task as done too. In reverse, it would be handy if it would auto-mark-done all child tasks when I mark their parent task as done.</li>
<li>The context menu contains items that don't make sense, such as font and colours.</li>
</ul>
<p>Niggles, really is the word, isn't it?! I need to stress the application more so that I can find an important thing to complain about!</p>
<p>Hog Bay Software is run by Jesse, who is a really nice guy as he even answered my emailed bug report even though I was just a trial user. I've since bought the product as to my mind it's well worth the money.</p>
<p>I'm now looking for a "diary" type program that will present me with a blank page every day automatically. Bonus points if it allows tagging of pages to help me find stuff I've stored and I'd also like it to store its files in RTF files or similar so that I can take them to Pages with no hassle. So far, I've looked at Journler, Jotter and MacJournal so far, but all require me to start a new entry manually.</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/software/taskpaper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion&#039;s svn:externals</title>
		<link>http://akrabat.com/zend-framework/subversions-svnexternals/</link>
		<comments>http://akrabat.com/zend-framework/subversions-svnexternals/#comments</comments>
		<pubDate>Sat, 20 Jan 2007 15:07:15 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.akrabat.com/2007/01/20/subversions-svnexternals/</guid>
		<description><![CDATA[I know everyone else is already doing it, but I've only just got around to working out how svn externals works and why it's quite cool. I've got a Zend Framework application that I'm working on in subversion and it has a lib directory which contains a zf directory. The zf directory is a checkout [...]]]></description>
			<content:encoded><![CDATA[<p>I know everyone else is already doing it, but I've only just got around to working out how svn externals works and why it's quite cool.</p>
<p>I've got a Zend Framework application that I'm working on in subversion and it has a lib directory which contains a zf directory. The zf directory is a checkout of the latest trunk version of the framework. Up to to now, I've been doing this manually.</p>
<p>Today I sat down for all of 10 mins and sorted out subversion's svn:externals functionality to make it do the legwork. It's dead easy.</p>
<p>Command line:</p>
<pre>
cd lib
svn propedit svn:externals .</pre>
<p>(Don't forget to ensure that the EDITOR environment variable is set!)</p>
<p>I then added</p>
<pre>
zf http://framework.zend.com/svn/framework/trunk
</pre>
<p>in the editor (a file called svn-prop.tmp, apparently) and saved and closed the editor.</p>
<p>All that's required now is an <tt>svn update</tt> to automatically pull in the Zend Framework code automatically for me. </p>
<p>By the way, you have to do a svn commit to actually commit the propedit change too.</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/zend-framework/subversions-svnexternals/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Firefox 2 beta 2</title>
		<link>http://akrabat.com/software/firefox-2-beta-2/</link>
		<comments>http://akrabat.com/software/firefox-2-beta-2/#comments</comments>
		<pubDate>Fri, 01 Sep 2006 22:32:16 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.akrabat.com/2006/09/01/firefox-2-beta-2/</guid>
		<description><![CDATA[Beware this beta! A new theme is in the works and it wasn't ready when beta 2 was released... I use Windows Classic and the tabs are terrible and don't follow my system colours at all. Very very odd. I'm assuming it'll be fixed by the release of Firefox2 as the regression list is long [...]]]></description>
			<content:encoded><![CDATA[<p>Beware this beta! A new theme is in the works and it wasn't ready when beta 2 was released...</p>
<p>I use Windows Classic and the tabs are terrible and don't follow my system colours at all. </p>
<p>Very very odd. I'm assuming it'll be fixed by the release of Firefox2 as the <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=347454">regression list</a> is long and being tackled. <a href="http://blog.jedbrown.net/?p=66">Jed Brown</a> covers the actual problems in more detail.</p>
<p>Other than the theme, Firefox2 is shaping up quite nicely :)</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/software/firefox-2-beta-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
