<?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>non-random ramble &#187; os x</title>
	<atom:link href="http://jimbarritt.com/non-random/category/code/os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://jimbarritt.com/non-random</link>
	<description>adventures in code</description>
	<lastBuildDate>Tue, 20 Sep 2011 13:16:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Colorised Build Success Message</title>
		<link>http://jimbarritt.com/non-random/2010/04/25/colorised-build-success-message/</link>
		<comments>http://jimbarritt.com/non-random/2010/04/25/colorised-build-success-message/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 18:05:16 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[linux commands]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=450</guid>
		<description><![CDATA[My current project has a neat trick we picked up where the build has a red or green banner at the end when you run it locally to give good feedback about the build status. I&#8217;m not sure who originated it, but thanks! I just had to tweak it a bit to get it working [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/04/Build-Result.gif" rel="lightbox[450]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/04/Build-Result.gif" alt="" title="Build Result" width="681" height="248" class="aligncenter size-full wp-image-451" /></a></p>
<p>My current project has a neat trick we picked up where the build has a red or green banner at the end when you run it locally to give good feedback about the build status. I&#8217;m not sure who originated it, but thanks!</p>
<p>I just had to tweak it a bit to get it working on OS X so I thought I would document the trick here.</p>
<p><code>run.sh - OS X</code></p>
<pre name='code' class='java:nogutter:nocontrols'>
CMD=&#8221;./tools/ant/bin/ant -lib ./asl/lib/jdepend $@&#8221;
echo &#8220;Running command [${CMD}] &#8230;&#8221;
$CMD
if [ "$?" -ne 0 ]; then
    echo -e &#8220;`tput setab 1`  `cat ./ci/failed.txt` `tput setab 0`&#8221;
    exit 1
else
    echo -e &#8220;`tput setab 2`  `cat ./ci/passed.txt`  `tput setab 0`&#8221;
    exit 0
fi
</pre>
<p>This assumes you have two supporting files <code>./ci/passed.txt</code> and <code>./ci/failed.txt</code> which contain the message. You can generate messages to your taste <a href="http://www.network-science.de/ascii/">here</a>. </p>
<p>I have provided the files in this example here :</p>
<p><a href='http://jimbarritt.com/non-random/wp-content/uploads/2010/04/passed.txt'>passed.txt</a></p>
<p><a href='http://jimbarritt.com/non-random/wp-content/uploads/2010/04/failed.txt'>failed.txt</a></p>
<p>It has also been run under Ubuntu where the following works (it didnt work on OS X which is why I adapted it), but the <code>tput</code> should also work on Ubuntu. I&#8217;ve not explicitly tested this one!</p>
<pre name='code' class='java:nogutter:nocontrols'>
if [ "$?" -ne 0 ]; then
    echo -e &#8220;\E[30;41m"
    cat ./ci/failed.txt
    echo -e "\E[0m"
    exit 1
else
    echo -e "\E[30;42m"
    cat ./ci/passed.txt
    echo -e "\E[0m"
    exit 0
fi
</pre>
<p>Under windows you can actually make the entire screen of the terminal change color:</p>
<p><code>run.bat - WINDOWS</code></p>
<pre name='code' class='java:nogutter:nocontrols'>
CALL tools\ant\bin\ant %*
IF ERRORLEVEL 1 GOTO RedBuild
IF ERRORLEVEL 0 GOTO GreenBuild
:RedBuild
color 4F
GOTO TheEnd
:GreenBuild
color 2F
:TheEnd
PAUSE
color 07
</pre>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjimbarritt.com%2Fnon-random%2F2010%2F04%2F25%2Fcolorised-build-success-message%2F&amp;title=Colorised%20Build%20Success%20Message"><img src="http://jimbarritt.com/non-random/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/04/25/colorised-build-success-message/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Sources (src.jar) for JDK on OSX</title>
		<link>http://jimbarritt.com/non-random/2009/12/02/java-sources-src-jar-for-jdk-on-osx/</link>
		<comments>http://jimbarritt.com/non-random/2009/12/02/java-sources-src-jar-for-jdk-on-osx/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 10:19:41 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[jdk]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=320</guid>
		<description><![CDATA[I just discovered that I don&#8217;t have the src.jar for my JDK installation and took a bit of ferreting about to find out that you need to download and install the JDK documentation bundle from apple developer site, aswell as the actual jdk. You can see the thread I found here The downloads for both [...]]]></description>
			<content:encoded><![CDATA[<p>I just discovered that I don&#8217;t have the src.jar for my JDK installation and took a bit of ferreting about to find out that you need to download and install the JDK documentation bundle from apple developer site, aswell as the actual jdk.</p>
<p>You can see the thread I found <a href="http://lists.apple.com/archives/Java-dev/2008/Sep/msg00360.html">here</a></p>
<p>The downloads for both the JDK and the associated documentation live <a href="https://connect.apple.com">here</a> login and go to downloads. You want &#8220;Java for Mac OS X Release X&#8221; and &#8220;Java for Mac OS X Release X Developer documentation&#8221;</p>
<p>It then lives in (e.g) <code>/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home</code></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjimbarritt.com%2Fnon-random%2F2009%2F12%2F02%2Fjava-sources-src-jar-for-jdk-on-osx%2F&amp;title=Java%20Sources%20%28src.jar%29%20for%20JDK%20on%20OSX"><img src="http://jimbarritt.com/non-random/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2009/12/02/java-sources-src-jar-for-jdk-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacWidgets &#8211; Java Swing looking native on OS X</title>
		<link>http://jimbarritt.com/non-random/2009/11/15/macwidgets-java-swing-looking-native-on-os-x/</link>
		<comments>http://jimbarritt.com/non-random/2009/11/15/macwidgets-java-swing-looking-native-on-os-x/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 22:33:15 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[swing]]></category>
		<category><![CDATA[thoughtblog]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=241</guid>
		<description><![CDATA[I just discovered Exploding Pixels&#8217; MacWidgets. Its a beautiful library. Literally just pasted a couple of lines of code into my Java app and now it looks right at home on the os x desktop. I&#8217;m running JDK 1.6 on Leopard. Here is is in action: And here is the code (its been edited slightly [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://exploding-pixels.com/google_code/graphics/UnifiedToolBar.png" /></p>
<p>I just discovered <a href="http://explodingpixels.wordpress.com/">Exploding Pixels&#8217;</a> <a href="http://code.google.com/p/macwidgets/">MacWidgets</a>. Its a beautiful library. Literally just pasted a couple of lines of code into my Java app and now it looks right at home on the os x desktop. I&#8217;m running JDK 1.6 on Leopard. </p>
<p>Here is is in action:</p>
<p><img src="http://jimbarritt.com/non-random/wp-content/uploads/2009/11/macwidgets-demo.jpg" alt="macwidgets-demo" title="macwidgets-demo" width="730" height="535" class="alignnone size-full wp-image-268" /></p>
<p>And here is the code (its been edited slightly so may not copy and paste, but you get the idea) &#8230;</p>
<pre name='code' class='java:nogutter:nocontrols'>
&nbsp;
        MacUtils.makeWindowLeopardStyle(getRootPane());
&nbsp;
        UnifiedToolBar toolBar = new UnifiedToolBar();
&nbsp;
        JButton button = new JButton(&#8220;My Button&#8221;);
        button.putClientProperty(&#8220;JButton.buttonType&#8221;, &#8220;textured&#8221;);
        toolBar.addComponentToLeft(button);
&nbsp;
        getContentPane().add(toolBar.getComponent(), BorderLayout.NORTH);
&nbsp;
        BottomBar bottomBar = new BottomBar(BottomBarSize.SMALL);
        bottomBar.addComponentToLeft(MacWidgetFactory.createEmphasizedLabel(&#8221; Status&#8221;));
&nbsp;
        getContentPane().add(bottomBar.getComponent(), BorderLayout.SOUTH);
&nbsp;
</pre>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjimbarritt.com%2Fnon-random%2F2009%2F11%2F15%2Fmacwidgets-java-swing-looking-native-on-os-x%2F&amp;title=MacWidgets%20%26%238211%3B%20Java%20Swing%20looking%20native%20on%20OS%20X"><img src="http://jimbarritt.com/non-random/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2009/11/15/macwidgets-java-swing-looking-native-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iTerm &#8211; Upgrade your Terminal</title>
		<link>http://jimbarritt.com/non-random/2009/08/09/iterm-upgrade-your-terminal/</link>
		<comments>http://jimbarritt.com/non-random/2009/08/09/iterm-upgrade-your-terminal/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 10:51:30 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[linux commands]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[thoughtblog]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2009/08/09/iterm-upgrade-your-terminal/</guid>
		<description><![CDATA[Spending a lot of time in various ssh sessions? A bit tired of trying to remember which tab is on which server with the default os x terminal ? So was I. Hunting around, I saw various hacks (e.g. a bash script, or applescript) to achieve this but also an app called iTerm. Its free [...]]]></description>
			<content:encoded><![CDATA[<p>Spending a lot of time in various ssh sessions?</p>
<p>A bit tired of trying to remember which tab is on which server with the default os x terminal ?</p>
<p>So was I. Hunting around, I saw various hacks (e.g. a <a href="http://pseudogreen.org/blog/set_tab_names_in_leopard_terminal.html">bash script</a>, or <a href="http://forums.macosxhints.com/showthread.php?t=58912">applescript</a>) to achieve this but also an app called <a href="http://iterm.sourceforge.net/">iTerm</a>.</p>
<p>Its free and within 30mins I was pretty much back to my previous terminal existence but with the names of my servers and my username in the tabs titles.</p>
<p>Awesome.</p>
<p>Some things I learned:</p>
<p>1) Some of the preferences I had to hunt for:</p>
<p>Not everything is available from iTerm&#8211;>Preferences. There are a couple of menu options of interest (this is iTerm 0.9.6).</p>
<p>View&#8211;>Show Session Info &#8230;</p>
<p>This lets you change the colors and fonts, etc for your terminal window and also update the default.</p>
<p>Bookmarks &#8211;> Manage Profiles &#8230;</p>
<p>This is where you can set a lot more options about your session, including making the cursor blink (Something for some reason I found essential:) </p>
<p>The reason they are here is because they are associated with bookmarks, a powerful feature that for example allows you to bookmark an ssh session, and have a whole set of preferences associated with that session.</p>
<p>I would like to see them all aggregated under the &#8220;Preferences&#8221; option though, because as a os x user, thats where I expect to find everything that I can configure (Posted as an <a href="https://sourceforge.net/tracker/?func=detail&#038;aid=2834416&#038;group_id=67789&#038;atid=518976">feature request</a>.</p>
<p>2) I wanted the title to change whenever I change directory. Simple, just need the following in my <code>~/.bash_profile</code> (see <a href="http://joshstaiger.org/archives/2005/07/bash_profile_vs.html">here</a> for differences between <code>~/.bashrc</code>:</p>
<pre>
export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}: ${PWD/#$HOME/~}\007"'
</pre>
<p>3) This one is not probably very &#8220;good form&#8221;, but I really like the icon for the os x terminal window. So simply &#8220;Show Package Contents&#8221; on the iTerm.app and swap out <code>/Contents/Resources/iTerm.icns</code> with the equivalent in the Terminal application <code>Terminal.icns</code></p>
<p>4) I also wanted a &#8220;close x&#8221; icon on each tab, and discovered that this is under Preferences &#8211;> Tab &#8211;> Use compact tab labels. You want to UN check this.</p>
<p>I now have exactly the same user experience as before with some great bonuses, for example, a cool feature is the &#8220;blur&#8221; of the transparency behind the window. </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjimbarritt.com%2Fnon-random%2F2009%2F08%2F09%2Fiterm-upgrade-your-terminal%2F&amp;title=iTerm%20%26%238211%3B%20Upgrade%20your%20Terminal"><img src="http://jimbarritt.com/non-random/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2009/08/09/iterm-upgrade-your-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IntelliJ Crashes on OS X</title>
		<link>http://jimbarritt.com/non-random/2009/08/01/intellij-crashes-on-os-x/</link>
		<comments>http://jimbarritt.com/non-random/2009/08/01/intellij-crashes-on-os-x/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 09:48:00 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[ides]]></category>
		<category><![CDATA[jdk]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2009/08/01/intellij-crashes-on-os-x/</guid>
		<description><![CDATA[I have been running v.8 of IntelliJ on os x for a while now, and noticed the odd crash, particularly after waking up the computer. Thanks to my colleague Tom Czarniecki I have found a solution that appears to be working. Some googling turned up very little, but mostly points to the JVM being the [...]]]></description>
			<content:encoded><![CDATA[<p>I have been running v.8 of IntelliJ on os x for a while now, and noticed the odd crash, particularly after waking up the computer.</p>
<p>Thanks to my colleague <a href="http://watchitlater.com/blog/about">Tom Czarniecki</a> I have found a solution that appears to be working.</p>
<p>Some googling turned up very little, but mostly points to the JVM being the problem. I had tried updating the Java installed on os x and setting the JDK to be 1.5 which did seem to improve stability but still crashed.</p>
<p>Tom pointed out that Intellij also has a configuration for the JDK version in its config which I updated to be 1.6+ and then switched my JDK back to 1.6 64bit. That was a week ago and not only have I had no crashes, of course the whole experience is smoother under 1.6! woo hoo!</p>
<p>The trick lies in the file</p>
<pre name='code' class='java:nogutter:nocontrols'>
/Applications/IntelliJ IDEA 8.1.3.app/Contents/Info.plist
</pre>
<pre name='code' class='java:nogutter:nocontrols'>
&lt;key&gt;JVMVersion&lt;/key&gt;
&lt;string&gt;1.6*&lt;/string&gt;
</pre>
<p>To Switch JDKs:</p>
<pre name='code' class='java:nogutter:nocontrols'>
/Applications/Utilities/Java/Java Preferences.app
</pre>
<p>Some other references I found along the way:</p>
<p><a href="http://www.jetbrains.net/devnet/thread/282406">http://www.jetbrains.net/devnet/thread/282406</a> </p>
<p>JDK Update:</p>
<p><a href="http://www.apple.com/downloads/macosx/apple/application_updates/javaformacosx105update4.html">http://www.apple.com/downloads/macosx/apple/application_updates/javaformacosx105update4.html</a></p>
<p>To See IntelliJ Log output:</p>
<p> ~/Library/Caches/IntelliJIDEA8x/log/</p>
<p>UPDATE:</p>
<p>For Intellij9:</p>
<p>/Users/jim/Library/Logs/IntelliJIdea90/idea.log</p>
<p>(I found this using the activity monitor and then &#8220;inspect process&#8221; and you can see a list of open files and ports)</p>
<p>IntelliJ stores its plugins here (Thanks to <a href="http://blog.cotopia.com/2008/08/uninstall-intellij-plugins-on-os-x.html">these guys</a>) :</p>
<p>~/Library/Application Support/IntelliJIDEA80</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjimbarritt.com%2Fnon-random%2F2009%2F08%2F01%2Fintellij-crashes-on-os-x%2F&amp;title=IntelliJ%20Crashes%20on%20OS%20X"><img src="http://jimbarritt.com/non-random/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2009/08/01/intellij-crashes-on-os-x/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>OS X Backup with psync</title>
		<link>http://jimbarritt.com/non-random/2009/07/19/os-x-backup-with-psync/</link>
		<comments>http://jimbarritt.com/non-random/2009/07/19/os-x-backup-with-psync/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 11:15:54 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2009/07/19/os-x-backup-with-psync/</guid>
		<description><![CDATA[My laptop is behaving strangely, which makes me want to back up, fast! I love this utility which copies the whole of your folders, including permissions and hidden system files. The standard copy in finder often balks at some things. http://psyncx.sourceforge.net/ Enjoy.]]></description>
			<content:encoded><![CDATA[<p>My laptop is behaving strangely, which makes me want to back up, fast!</p>
<p>I love this utility which copies the whole of your folders, including permissions and hidden system files.</p>
<p>The standard copy in finder often balks at some things.</p>
<p>http://psyncx.sourceforge.net/</p>
<p>Enjoy.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjimbarritt.com%2Fnon-random%2F2009%2F07%2F19%2Fos-x-backup-with-psync%2F&amp;title=OS%20X%20Backup%20with%20psync"><img src="http://jimbarritt.com/non-random/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2009/07/19/os-x-backup-with-psync/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UK English Spell Checking in OS X</title>
		<link>http://jimbarritt.com/non-random/2009/05/20/uk-english-spell-checking-in-os-x/</link>
		<comments>http://jimbarritt.com/non-random/2009/05/20/uk-english-spell-checking-in-os-x/#comments</comments>
		<pubDate>Wed, 20 May 2009 12:55:27 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2009/05/20/uk-english-spell-checking-in-os-x/</guid>
		<description><![CDATA[System Preferences > International > Languages and click the ‘Edit List…’ button, select British English and click ‘OK’. Now drag it to the top of the list and everything should be in British English.]]></description>
			<content:encoded><![CDATA[<p>System Preferences > International > Languages and click the ‘Edit List…’ button, select British English and click ‘OK’. Now drag it to the top of the list and everything should be in British English.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjimbarritt.com%2Fnon-random%2F2009%2F05%2F20%2Fuk-english-spell-checking-in-os-x%2F&amp;title=UK%20English%20Spell%20Checking%20in%20OS%20X"><img src="http://jimbarritt.com/non-random/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2009/05/20/uk-english-spell-checking-in-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show hidden files for OS X</title>
		<link>http://jimbarritt.com/non-random/2008/10/20/show-hidden-files-for-os-x/</link>
		<comments>http://jimbarritt.com/non-random/2008/10/20/show-hidden-files-for-os-x/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 10:04:14 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2008/10/20/show-hidden-files-for-os-x/</guid>
		<description><![CDATA[defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder]]></description>
			<content:encoded><![CDATA[<pre>
    <code>
    defaults write com.apple.finder AppleShowAllFiles TRUE

    killall Finder
    </code>
</pre>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjimbarritt.com%2Fnon-random%2F2008%2F10%2F20%2Fshow-hidden-files-for-os-x%2F&amp;title=Show%20hidden%20files%20for%20OS%20X"><img src="http://jimbarritt.com/non-random/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2008/10/20/show-hidden-files-for-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install of mono 2.0 failed on OS X PowerBook G4</title>
		<link>http://jimbarritt.com/non-random/2008/10/16/install-of-mono-20-failed-on-os-x-powerbook-g4/</link>
		<comments>http://jimbarritt.com/non-random/2008/10/16/install-of-mono-20-failed-on-os-x-powerbook-g4/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 17:24:55 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[thoughtblog]]></category>
		<category><![CDATA[thoughtworks]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2008/10/16/install-of-mono-20-failed-on-os-x-powerbook-g4/</guid>
		<description><![CDATA[I just tried to install mono version 2 from darwin ports. Before starting i uninstalled the mono i had already: #!/bin/sh -x #This script removes Mono from an OS X System. It must be run as root rm -r /Library/Frameworks/Mono.framework rm -r /Library/Receipts/MonoFramework-SVN.pkg cd /usr/bin for i in `ls -al &#124; grep Mono &#124; awk [...]]]></description>
			<content:encoded><![CDATA[<p>I just tried to install mono version 2 from darwin ports.</p>
<p>Before starting i uninstalled the mono i had already:</p>
<pre>
<code>
#!/bin/sh -x
#This script removes Mono from an OS X System.  It must be run as root
rm -r /Library/Frameworks/Mono.framework
rm -r /Library/Receipts/MonoFramework-SVN.pkg
cd /usr/bin
for i in `ls -al | grep Mono | awk '{print $9}'`; do
rm ${i}
done
</code>
</pre>
<p>First i could search for the mono package by typing</p>
<p><code>$ port search mono</code></p>
<p>To begin with this did not show the right version so i did :</p>
<p><code>$ port selfupdate</code></p>
<p>This checks for a new version of port and updates its list of available software.</p>
<p>now i see:</p>
<pre>
<code>
coco:~ Jim$ port search mono
mono                           devel/mono     2.0          Implementation of the .NET Development Framework
mono-addins                    devel/mono-addins 0.3          Mono.Addins is a framework for creating extensible applications
monodoc                        devel/monodoc  2.0          Documentation for the Mono .NET Development Framework
monotone                       devel/monotone 0.41         A distributed version control system
mod_mono                       www/mod_mono   1.1.16.1     an Apache plug-in for hosting the Mono System.Web classes
coco:~ Jim$
</code>
</pre>
<p>so all good, i ran</p>
<p><code>port install mono</code></p>
<p>but get :</p>
<pre>
<code>
darwin_stop_world.c:307: error: 'ppc_thread_state_t' has no member named '__r31'
make[3]: *** [darwin_stop_world.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
</code>
</pre>
<p>A quick search on google brought this:</p>
<p><a href='http://lists.macosforge.org/pipermail/macports-tickets/2008-February/005279.html'>http://lists.macosforge.org/pipermail/macports-tickets/2008-February/005279.html</a></p>
<p>The instructions here talk about editing this <code>darwin_stop_world.c</code> file and changing some constant values. They give the path to the file for an older version but a bit of <code>ls</code> ing turned up the new folder:</p>
<p><code>/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/<b>mono-2.0</b>/libgc/darwin_stop_world.c</code></p>
<p>Ok, so now the tricksy bit&#8230;</p>
<p>The instructions in the above link talk about some constants not set up correctly. On the line wher ei saw my exception, it was referring to the following bit of code:</p>
<pre>
<code>
#elif defined(POWERPC)
#if defined(_STRUCT_PPC_EXCEPTION_STATE)
	lo = (void*)(state.__r1 - PPC_RED_ZONE_SIZE);

	GC_push_one(state.__r0);
	GC_push_one(state.__r2);
	GC_push_one(state.__r3);
	GC_push_one(state.__r4);
	GC_push_one(state.__r5);
	GC_push_one(state.__r6);
	GC_push_one(state.__r7);
	GC_push_one(state.__r8);
	GC_push_one(state.__r9);
	GC_push_one(state.__r10);
	GC_push_one(state.__r11);
	GC_push_one(state.__r12);
	GC_push_one(state.__r13);
	GC_push_one(state.__r14);
	GC_push_one(state.__r15);
	GC_push_one(state.__r16);
	GC_push_one(state.__r17);
	GC_push_one(state.__r18);
	GC_push_one(state.__r19);
	GC_push_one(state.__r20);
	GC_push_one(state.__r21);
	GC_push_one(state.__r22);
	GC_push_one(state.__r23);
	GC_push_one(state.__r24);
	GC_push_one(state.__r25);
	GC_push_one(state.__r26);
	GC_push_one(state.__r27);
	GC_push_one(state.__r28);
	GC_push_one(state.__r29);
	GC_push_one(state.__r30);
	GC_push_one(state.__r31);
#else
</code>
</pre>
<p>in the post, he seemed to simply remove all the &#8216;__&#8217; underscores and it worked&#8230; so:</p>
<pre>
<code>
	#if defined(_STRUCT_PPC_EXCEPTION_STATE)
		lo = (void*)(state.r1 - PPC_RED_ZONE_SIZE);

		GC_push_one(state.r0);
		GC_push_one(state.r2);
		GC_push_one(state.r3);
		GC_push_one(state.r4);
		GC_push_one(state.r5);
		GC_push_one(state.r6);
		GC_push_one(state.r7);
		GC_push_one(state.r8);
		GC_push_one(state.r9);
		GC_push_one(state.r10);
		GC_push_one(state.r11);
		GC_push_one(state.r12);
		GC_push_one(state.r13);
		GC_push_one(state.r14);
		GC_push_one(state.r15);
		GC_push_one(state.r16);
		GC_push_one(state.r17);
		GC_push_one(state.r18);
		GC_push_one(state.r19);
		GC_push_one(state.r20);
		GC_push_one(state.r21);
		GC_push_one(state.r22);
		GC_push_one(state.r23);
		GC_push_one(state.r24);
		GC_push_one(state.r25);
		GC_push_one(state.r26);
		GC_push_one(state.r27);
		GC_push_one(state.r28);
		GC_push_one(state.r29);
		GC_push_one(state.r30);
		GC_push_one(state.r31);
	#else
</code>
</pre>
<p>This was defined on lines 130 and 273</p>
<p>the second one now looks like :</p>
<pre>
	<code>
		#if defined(_STRUCT_PPC_EXCEPTION_STATE)
			lo = (void*)(info.r1 - PPC_RED_ZONE_SIZE);
			hi = (ptr_t)FindTopOfStack(info.r1);

			GC_push_one(info.r0);
			GC_push_one(info.r2);
			GC_push_one(info.r3);
			GC_push_one(info.r4);
			GC_push_one(info.r5);
			GC_push_one(info.r6);
			GC_push_one(info.r7);
			GC_push_one(info.r8);
			GC_push_one(info.r9);
			GC_push_one(info.r10);
			GC_push_one(info.r11);
			GC_push_one(info.r12);
			GC_push_one(info.r13);
			GC_push_one(info.r14);
			GC_push_one(info.r15);
			GC_push_one(info.r16);
			GC_push_one(info.r17);
			GC_push_one(info.r18);
			GC_push_one(info.r19);
			GC_push_one(info.r20);
			GC_push_one(info.r21);
			GC_push_one(info.r22);
			GC_push_one(info.r23);
			GC_push_one(info.r24);
			GC_push_one(info.r25);
			GC_push_one(info.r26);
			GC_push_one(info.r27);
			GC_push_one(info.r28);
			GC_push_one(info.r29);
			GC_push_one(info.r30);
			GC_push_one(info.r31);
		#else
	</code>
</pre>
<p>Watch out for the top of stack one! its an extra one.</p>
<p>ok this works!</p>
<p>I had to restart the terminal because it didnt seem to find the new programs &#8211; it still thought mcs lived in /usr/bin not /opt/local/bin which is where port puts it.</p>
<p>Now i can compile c# version 3.0!! </p>
<p>oh yeah, be sure to use <code>gmcs</code> to compile, not <code>mcs</code> which is the old one.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjimbarritt.com%2Fnon-random%2F2008%2F10%2F16%2Finstall-of-mono-20-failed-on-os-x-powerbook-g4%2F&amp;title=Install%20of%20mono%202.0%20failed%20on%20OS%20X%20PowerBook%20G4"><img src="http://jimbarritt.com/non-random/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2008/10/16/install-of-mono-20-failed-on-os-x-powerbook-g4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X Boot / Startup Keys</title>
		<link>http://jimbarritt.com/non-random/2007/12/03/mac-os-x-boot-startup-keys/</link>
		<comments>http://jimbarritt.com/non-random/2007/12/03/mac-os-x-boot-startup-keys/#comments</comments>
		<pubDate>Sun, 02 Dec 2007 16:07:27 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[os x]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2007/12/03/mac-os-x-boot-startup-keys/</guid>
		<description><![CDATA[So there are other places where these can be found but im always forgetting where they are. Here are a few choice ones. They all need to be held down after boot when the noise happens. Mouse down : eject media shift : disable login items cmd-v : show console cmd-s : single user mode [...]]]></description>
			<content:encoded><![CDATA[<p>So there are other places where these can be found but im always forgetting where they are. Here are a few choice ones.</p>
<p>They all need to be held down after boot when the noise happens.</p>
<ul>
<li>Mouse down : eject media</li>
<li>shift :  disable login items</li>
<li>cmd-v : show console</li>
<li>cmd-s : single user mode</li>
<li>c : boot from CD</li>
</ul>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fjimbarritt.com%2Fnon-random%2F2007%2F12%2F03%2Fmac-os-x-boot-startup-keys%2F&amp;title=Mac%20OS%20X%20Boot%20%2F%20Startup%20Keys"><img src="http://jimbarritt.com/non-random/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2007/12/03/mac-os-x-boot-startup-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

