<?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; Computing</title>
	<atom:link href="http://akrabat.com/category/computing/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>Changing OS X Terminal colours when ssh&#039;ing into a server</title>
		<link>http://akrabat.com/php/osx-terminal-colours/</link>
		<comments>http://akrabat.com/php/osx-terminal-colours/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 09:40:25 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=779</guid>
		<description><![CDATA[I recently discovered that iTerm has bookmarks so you can set up a bookmark to ssh into a server and change the colours of the window. This makes it easy to remember which terminal window is for which server. Thinking about it, I wondered if you could change the colours of the standard OS X [...]]]></description>
			<content:encoded><![CDATA[<p>I recently discovered that iTerm has bookmarks so you can set up a bookmark to ssh into a server and change the colours of the window. This makes it easy to remember which terminal window is for which server.</p>
<p>Thinking about it, I wondered if you could change the colours of the standard OS X Terminal via AppleScript. Inpired by Red Sweater's <a href="http://www.red-sweater.com/blog/220/random-color-terminal">Random Color Terminal</a> post, I wrote some code to automatically change the Terminal colour whenever I ssh into a known server.</p>
<p>As I know PHP and PHP is installed on OS X, I used that :)</p>
<p>The key to controlling AppleScript via PHP is the <tt>osascript</tt> command line application. The code I need specifically is:<br />
<!-- more --></p>
<pre class="phpcode"><span style="color: #0000BB">
system</span><span style="color: #007700">(</span><span style="color: #DD0000">"osascript&nbsp;-e&nbsp;'tell&nbsp;application&nbsp;\"Terminal\"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;targetWindow&nbsp;to&nbsp;window&nbsp;1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;background&nbsp;color&nbsp;of&nbsp;targetWindow&nbsp;to&nbsp;{"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$bgColour&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;cursor&nbsp;color&nbsp;of&nbsp;targetWindow&nbsp;to&nbsp;{"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$fgColour&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;normal&nbsp;text&nbsp;color&nbsp;of&nbsp;targetWindow&nbsp;to&nbsp;{"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$fgColour&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;bold&nbsp;text&nbsp;color&nbsp;of&nbsp;targetWindow&nbsp;to&nbsp;{"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$fgColour&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;tell'&nbsp;"</span><span style="color: #007700">);
</span>
</span></code></pre>
<p>where <tt>$bgColour</tt> and <tt>$fgColour</tt> are comma separated strings containing three numbers between 0 and 65535 as AppleScript colours are 16 bit.</p>
<p>We start by getting a command line solution where we can type:<br />
<tt>    termcolour.php white</tt><br />
or<br />
<tt>    termcolour.php 00ff00</tt><br />
or<br />
<tt>    termcolour.php 255 0 0</tt></p>
<p>and have the background colour of the Terminal change to the colour we have asked for. </p>
<h3>TerminalColour class</h3>
<p>Firstly we need a class that can change the colour of the Terminal window for us and also translate colours from 8bit RGB to 16bit RGB. As it is also useful to be able to specify colours by name, eg. "white", we'll add a lookup system too. I store this in /usr/local/bin.</p>
<p>This class is quite long, so this is a snippet:</p>
<pre class="phpcode">
<span style="color: #0000BB">&lt;?php
</span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">TerminalColour
</span><span style="color: #007700">{
&nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;</span><span style="color: #0000BB">$_colour&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'255'</span><span style="color: #007700">,</span><span style="color: #DD0000">'255'</span><span style="color: #007700">,</span><span style="color: #DD0000">'255'</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/**
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;List&nbsp;of&nbsp;colours
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">protected&nbsp;</span><span style="color: #0000BB">$_colours&nbsp;</span><span style="color: #007700">=&nbsp;array(
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'white'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'ffffff'</span><span style="color: #007700">,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'black'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'000000'</span><span style="color: #007700">,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;etc
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/**
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Set&nbsp;the&nbsp;colour&nbsp;of&nbsp;the&nbsp;topmost&nbsp;Terminal&nbsp;window&nbsp;using&nbsp;AppleScript
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;$bgColour&nbsp;may&nbsp;be&nbsp;either&nbsp;an&nbsp;array&nbsp;of&nbsp;red,&nbsp;green,&nbsp;blue&nbsp;(8&nbsp;bit)&nbsp;or&nbsp;a&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;hex&nbsp;string&nbsp;or&nbsp;a&nbsp;string&nbsp;that&nbsp;matches&nbsp;an&nbsp;entry&nbsp;in&nbsp;the&nbsp;_colours&nbsp;lookup&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;list.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;$fgColour&nbsp;is&nbsp;null,&nbsp;then&nbsp;automatically&nbsp;use&nbsp;either&nbsp;black&nbsp;or
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;white&nbsp;based&nbsp;on&nbsp;brightness&nbsp;of&nbsp;$bgColour.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;array|string&nbsp;$bgColour
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;array|string&nbsp;$fgColour
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;array
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">setTerminalColour</span><span style="color: #007700">(</span><span style="color: #0000BB">$bgColour</span><span style="color: #007700">=</span><span style="color: #0000BB">null</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$fgColour</span><span style="color: #007700">=</span><span style="color: #0000BB">null</span><span style="color: #007700">)&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!</span><span style="color: #0000BB">is_null</span><span style="color: #007700">(</span><span style="color: #0000BB">$bgColour</span><span style="color: #007700">))&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setColour</span><span style="color: #007700">(</span><span style="color: #0000BB">$bgColour</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$bgColour&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getColour</span><span style="color: #007700">();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;convert&nbsp;from&nbsp;8&nbsp;bit&nbsp;colour&nbsp;numbers&nbsp;to&nbsp;16&nbsp;bit&nbsp;ones
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$bgColour&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">convertTo16bit</span><span style="color: #007700">(</span><span style="color: #0000BB">$bgColour</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$fgColour&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$fgColour&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getFgColour</span><span style="color: #007700">(</span><span style="color: #0000BB">$bgColour</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$bgColour&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">implode</span><span style="color: #007700">(</span><span style="color: #DD0000">','</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$bgColour</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$fgColour&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">implode</span><span style="color: #007700">(</span><span style="color: #DD0000">','</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$fgColour</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">system</span><span style="color: #007700">(</span><span style="color: #DD0000">"osascript&nbsp;-e&nbsp;'tell&nbsp;application&nbsp;\"Terminal\"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;targetWindow&nbsp;to&nbsp;window&nbsp;1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;background&nbsp;color&nbsp;of&nbsp;targetWindow&nbsp;to&nbsp;{"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$bgColour&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;cursor&nbsp;color&nbsp;of&nbsp;targetWindow&nbsp;to&nbsp;{"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$fgColour&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;normal&nbsp;text&nbsp;color&nbsp;of&nbsp;targetWindow&nbsp;to&nbsp;{"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$fgColour&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;bold&nbsp;text&nbsp;color&nbsp;of&nbsp;targetWindow&nbsp;to&nbsp;{"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$fgColour&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;tell'&nbsp;"</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;}
}
</span>
</span></code></pre>
<p>As you can see, there's a variety of helper methods that I've not show here. <tt>setColour()</tt> is the where we map from the types of input that the user will provide to an array. Other that that, it's fairly self-explanatory. </p>
<h3>Change colour from the command line</h3>
<p>Now we need a script that uses our class. <tt>termcolours.php</tt>, that I can execute from the command line to change any given Terminal window to a new background colour. </p>
<p><tt>termcolour.php</tt> is stored in /usr/local/bin and has execute permissions set using <tt>chmod a+x termcolour.php</tt> from the command line:</p>
<pre class="phpcode">
#!/usr/bin/php
<span style="color: #0000BB">&lt;?php
</span><span style="color: #007700">include&nbsp;</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">'/TerminalColour.php'</span><span style="color: #007700">;

</span><span style="color: #0000BB">process</span><span style="color: #007700">(</span><span style="color: #0000BB">$argc</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$argv</span><span style="color: #007700">);
exit;

function&nbsp;</span><span style="color: #0000BB">process</span><span style="color: #007700">(</span><span style="color: #0000BB">$argc</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$argv</span><span style="color: #007700">)
{
&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$argc&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;&lt;&lt;&lt;EOT
</span><span style="color: #DD0000">TerminalColour:&nbsp;Set&nbsp;the&nbsp;background&nbsp;colour&nbsp;of&nbsp;a&nbsp;Terminal.app&nbsp;window&nbsp;
USAGE:&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;1.&nbsp;termcolour.php&nbsp;{r}&nbsp;{g}&nbsp;{b}&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;({r},&nbsp;{g},&nbsp;{b}&nbsp;are&nbsp;between&nbsp;0&nbsp;and&nbsp;255)
&nbsp;&nbsp;&nbsp;&nbsp;2.&nbsp;termcolour.php&nbsp;{hexvalue}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;({hexvalue}&nbsp;assumed&nbsp;to&nbsp;be&nbsp;from&nbsp;000&nbsp;to&nbsp;fff&nbsp;or&nbsp;00000&nbsp;to&nbsp;ffffff)

</span><span style="color: #007700">EOT;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$tc&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">TerminalColour</span><span style="color: #007700">();
&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$argc&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">4</span><span style="color: #007700">)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;called&nbsp;with&nbsp;three&nbsp;arguments&nbsp;-&nbsp;treat&nbsp;as&nbsp;rgb&nbsp;values&nbsp;(0-255)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">array_shift</span><span style="color: #007700">(</span><span style="color: #0000BB">$argv</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;remove&nbsp;name&nbsp;of&nbsp;script
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$tc</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setTerminalColour</span><span style="color: #007700">(</span><span style="color: #0000BB">$argv</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$argc&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;called&nbsp;with&nbsp;one&nbsp;argument&nbsp;-&nbsp;either&nbsp;a&nbsp;lookup&nbsp;or&nbsp;a&nbsp;hex&nbsp;value
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$tc</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setTerminalColour</span><span style="color: #007700">(</span><span style="color: #0000BB">$argv</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]);
&nbsp;&nbsp;&nbsp;&nbsp;}
}
</span>
</span></code></pre>
<p>Again, not complicated. we check number of arguments to the script and if there are none, we display a help message. If there are exactly 1 or 3, then we call <tt>TerminalColour::setTerminalColour()</tt> appropriately.</p>
<h3>Hooking into SSH</h3>
<p>Lastly we hook into ssh and change the colour based on the server name.</p>
<p>To do this, I've used a simple shell script and modified termcolours.php to add some additional colour look up entries.</p>
<p><strong>/usr/local/bin/sshcolours.sh:</strong><br />
/usr/local/bin/termcolour.php $@<br />
/usr/bin/ssh $@<br />
/usr/local/bin/termcolour.php white</p>
<p><strong>termcolour.php</strong></p>
<pre class="phpcode"><span style="color: #0000BB">
</span><span style="color: #FF8000">//...
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$tc&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">TerminalColour</span><span style="color: #007700">();

&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;add&nbsp;colours&nbsp;for&nbsp;servers
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$colourLookup&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$tc</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getLookupColours</span><span style="color: #007700">();
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$serverColours&nbsp;</span><span style="color: #007700">=&nbsp;array(
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'server1'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$colourLookup</span><span style="color: #007700">[</span><span style="color: #DD0000">'darkblue'</span><span style="color: #007700">],
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'server2'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$colourLookup</span><span style="color: #007700">[</span><span style="color: #DD0000">'red'</span><span style="color: #007700">],
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'server3'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'C4DFC3'</span><span style="color: #007700">,
&nbsp;&nbsp;&nbsp;&nbsp;);
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$tc</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addToLookupColours</span><span style="color: #007700">(</span><span style="color: #0000BB">$serverColours</span><span style="color: #007700">);

&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$argc&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">4</span><span style="color: #007700">)&nbsp;{
</span><span style="color: #FF8000">//...
</span>
</span></code></pre>
<p>(not a large change!)</p>
<p>finally, we add an alias to ~/.bash_profile:</p>
<pre class="phpcode"><span style="color: #0000BB">
alias&nbsp;s</span><span style="color: #007700">=</span><span style="color: #0000BB">sshcolours</span><span style="color: #007700">.</span><span style="color: #0000BB">sh
</span>
</span></code></pre>
<p>That's it! I can now type:</p>
<pre>
	s server1
</pre>
<p>and Terminal's background colour turns blue and I'm ssh'd into server 1. </p>
<p>Sometimes I just type <tt>termcolour.php darkred</tt> to remind myself that this terminal window is doing something long-running and not to accidentally close it...</p>
<p>This is a <a href="/wp-content/uploads/terminal_colours.zip">zip file</a> of the relevant files.</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/php/osx-terminal-colours/feed/</wfw:commentRss>
		<slash:comments>2</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>Uninstalling MySQL on Mac OS X Leopard</title>
		<link>http://akrabat.com/computing/uninstalling-mysql-on-mac-os-x-leopard/</link>
		<comments>http://akrabat.com/computing/uninstalling-mysql-on-mac-os-x-leopard/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 20:48:06 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=258</guid>
		<description><![CDATA[To uninstall MySQL and completely remove it (including all databases) from your Mac do the following: Use mysqldump to backup your databases to text files! Stop the database server sudo rm /usr/local/mysql sudo rm -rf /usr/local/mysql* sudo rm -rf /Library/StartupItems/MySQLCOM sudo rm -rf /Library/PreferencePanes/My* edit /etc/hostconfig and remove the line MYSQLCOM=-YES- rm -rf ~/Library/PreferencePanes/My* sudo [...]]]></description>
			<content:encoded><![CDATA[<p>To uninstall MySQL and completely remove it (including all databases) from your Mac do the following:</p>
<ul>
<li>Use mysqldump to backup your databases to text files!</li>
<li>Stop the database server</li>
<li><tt>sudo rm /usr/local/mysql</tt></li>
<li><tt>sudo rm -rf /usr/local/mysql*</tt></li>
<li><tt>sudo rm -rf /Library/StartupItems/MySQLCOM</tt></li>
<li><tt>sudo rm -rf /Library/PreferencePanes/My*</tt></li>
<li>edit /etc/hostconfig and remove the line MYSQLCOM=-YES-</li>
<li><tt>rm -rf ~/Library/PreferencePanes/My*</tt></li>
<li><tt>sudo rm -rf /Library/Receipts/mysql*</tt></li>
<li><tt>sudo rm -rf /Library/Receipts/MySQL*</tt></li>
</ul>
<p>The last two lines are particularly important as otherwise, you can't install an older version of MySQL even though you think that you've completely deleted the newer version!</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/computing/uninstalling-mysql-on-mac-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>55</slash:comments>
		</item>
		<item>
		<title>On Mail.app</title>
		<link>http://akrabat.com/computing/on-mailapp/</link>
		<comments>http://akrabat.com/computing/on-mailapp/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 19:58:22 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://akrabat.com/2008/03/22/on-mailapp/</guid>
		<description><![CDATA[As I mentioned a while ago, I'm now using a MacBook Pro. All is going well, and I like Mail.app's search and data detectors very much. There are some niggles though that I miss from Thunderbird. My top 3 are: * GPG integration (Thunderbird's Enigmail) * Mail.app's insistence on attached PDFs and images inline * [...]]]></description>
			<content:encoded><![CDATA[<p>As I <a href="http://akrabat.com/2007/11/09/the-move-to-mac/">mentioned</a> a while ago, I'm now using a MacBook Pro. All is going well, and I like Mail.app's search and data detectors very much. There are some niggles though that I miss from Thunderbird. My top 3 are:</p>
<p>* GPG integration (Thunderbird's <a href="https://addons.mozilla.org/en-US/thunderbird/addon/71">Enigmail</a>)<br />
* Mail.app's insistence on attached PDFs and images inline<br />
* Filing mails to arbitrary folders using the keyboard (Thunderbird's <a href="https://addons.mozilla.org/en-US/thunderbird/addon/2487">nostalgy</a>)</p>
<p>It turns out that there are solutions to all three issues for OS X's Mail.app:</p>
<p>* <a href="http://www.sente.ch/software/GPGMail/">GPGMail</a> from Sente. (Not for Leopard, yet though)<br />
* <a href="http://lokiware.info/Mail-Attachments-Iconizer">Mail Attachments Iconizer</a> from Lokiware<br />
* <a href="http://www.tow.com/msgfiler/">MsgFiler</a> from tow.</p>
<p>I had found GPGMail a while ago and I"m looking forward to the Leopard release. In the meantime, I am getting by using the Services->GPG menu. I only learnt about the other two by accident.</p>
<p>Lokiware is sponsoring the <a href="http://daringfireball.net/">Daring Firebal</a>l RSS feed this week and John Gruber's write up about this event, pointed at <a href="http://www.macworld.com/article/132112/2008/02/msgfilermai.html">Dan Frakes’s Macworld article</a> which not only persuaded me to download Mail Attachments Iconizer also mentioned MsgFiler too.</p>
<p>I've bought both! Clearly sponsoring DF's RSS feed is worthwhile :)</p>
<p>Now, I'm trying to decide if I should buy Yojimbo...</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/computing/on-mailapp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cure for BSS announced!</title>
		<link>http://akrabat.com/computing/cure-for-bss-announced/</link>
		<comments>http://akrabat.com/computing/cure-for-bss-announced/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 19:02:58 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Around the web]]></category>
		<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://akrabat.com/2008/02/23/cure-for-bss-announced/</guid>
		<description><![CDATA[Cal Evans has announced a cure for Blank Stare Syndrome! You know the problem: you're in a conversation and someone mentions something about a new technology that you haven't heard of. Your eyes glaze and you have that Blank Stare... Sixty Second Tech is the solution. Once a week, it will deliver a short podcast [...]]]></description>
			<content:encoded><![CDATA[<p>Cal Evans has <a href="http://blog.calevans.com/2008/02/23/sixty-second-tech-the-tech-podcast-for-non-tech-people/">announced</a> a cure for Blank Stare Syndrome!</p>
<p>You know the problem: you're in a conversation and someone mentions something about a new technology that you haven't heard of. Your eyes glaze and you have that <em>Blank Stare</em>... </p>
<p><a href="http://www.sixtysecondtech.com/">Sixty Second Tech</a> is the solution. Once a week, it will deliver a short podcast (presumably about 60 seconds long!) that explains one technological concept per episode that you (or your less-techy friends!) need to know.</p>
<p>Head on over there and subscribe to the <a href="http://www.sixtysecondtech.com/feed/">RSS Feed</a> now - or wait for it to turn up on iTunes shortly.</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/computing/cure-for-bss-announced/feed/</wfw:commentRss>
		<slash:comments>0</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>svn and case-insentive file systems</title>
		<link>http://akrabat.com/off-topic/svn-and-case-insentive-file-systems/</link>
		<comments>http://akrabat.com/off-topic/svn-and-case-insentive-file-systems/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 18:56:31 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Off Topic]]></category>

		<guid isPermaLink="false">http://akrabat.com/2007/11/10/svn-and-case-insentive-file-systems/</guid>
		<description><![CDATA[Another one to chalk up to a doh! moment... I'm checking out my wife's website to my new MacBook and get this error message: svn: In directory 'website/gallery/piccies' svn: Can't move source to dest svn: Can't move 'website/gallery/piccies/.svn/tmp/prop-base/IMG_0013-thumb.jpg.svn-base' to 'website/gallery/piccies/.svn/prop-base/IMG_0013-thumb.jpg.svn-base': No such file or directory I'm pretty sure that there's no problem with the subversion [...]]]></description>
			<content:encoded><![CDATA[<p>Another one to chalk up to a doh! moment...</p>
<p>I'm checking out my wife's website to my new MacBook and get this error message:</p>
<blockquote><p>
svn: In directory 'website/gallery/piccies'<br />
svn: Can't move source to dest<br />
svn: Can't move 'website/gallery/piccies/.svn/tmp/prop-base/IMG_0013-thumb.jpg.svn-base' to 'website/gallery/piccies/.svn/prop-base/IMG_0013-thumb.jpg.svn-base': No such file or directory
</p></blockquote>
<p>I'm pretty sure that there's no problem with the subversion repository as I've been using it for months with no problem so I asked a friend to check it out on his Windows box... which failed with the same error. We thought at first that linux was allowing something illegal to occur which Windows and Macs weren't. Then we thought about the other differences between Linux and Windows/Mac OS X.</p>
<p>After a while. It turns out that there are two files in the directory: IMG_0013.jpg and IMG_0013.JPG. One svn mv command later and the problem is solved.</p>
<p>It would have been nice to have had a better error message though!</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/off-topic/svn-and-case-insentive-file-systems/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The move to Mac</title>
		<link>http://akrabat.com/computing/the-move-to-mac/</link>
		<comments>http://akrabat.com/computing/the-move-to-mac/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 08:17:57 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://akrabat.com/2007/11/09/the-move-to-mac/</guid>
		<description><![CDATA[A couple of days after Leopard came out, my wife and I found ourselves in the Apple store in Solihull and came away with an iMac for her and a MacBook Pro for me. The main reasons we have been interested in Macs recently are: Disappointed with Vista on my wife's brand new computer Disappointed [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of days after <a href="http://www.apple.com/uk/macosx/">Leopard</a> came out, my wife and I found ourselves in the Apple store in Solihull and came away with an iMac for her and a MacBook Pro for me.</p>
<p>The main reasons we have been interested in Macs recently are:</p>
<ul>
<li>Disappointed with Vista on my wife's brand new computer</li>
<li>Disappointed with our last two Inspiron laptops</li>
<li>Sleep that works</li>
<li>The hardware looks good!</li>
<li>Unix in the terminal</li>
</ul>
<p>Interestingly, the biggest benefit we've noticed since purchase is how quiet they are. We didn't realise how noisy those PCs under the desk actually were til we got rid of them.</p>
<p>The biggest challenge has been adapting to the keyboard. The @, " and \ keys in particular are in the "wrong" place, and carat navigation is maddeningly inconsistent between applications. I've worked out that Option+left/right move per word and command+left/right is supposed to move to the start/end of the line. Command+up/down usually moves to the top and bottom of the document, but I haven't found page up/down yet but suspect it has something to do with function option and up,down left or right!</p>
<p>We haven't worked out when we need to quit applications vs just closing the window which leaves the app running.</p>
<p>PHP 5.2.4 was installed by Apple and just needed turning on in httpd.conf (it's in /etc... did I mention how nice having Unix underneath is?!) What's odd is that PDO isn't there and so I suspect that I'm going to have to compile my own PHP at some point.</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/computing/the-move-to-mac/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
