<?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>distriqt // labs &#187; osx</title>
	<atom:link href="http://labs.distriqt.com/tag/osx/feed" rel="self" type="application/rss+xml" />
	<link>http://labs.distriqt.com</link>
	<description>flash platform &#38; digital development australia</description>
	<lastBuildDate>Fri, 27 Jan 2012 00:24:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Launching Multiple Instances of Eclipse</title>
		<link>http://labs.distriqt.com/post/844</link>
		<comments>http://labs.distriqt.com/post/844#comments</comments>
		<pubDate>Fri, 27 Jan 2012 00:24:57 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[shortcuts]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=844</guid>
		<description><![CDATA[I've been a fan of Eclipse for a long time now, even before FDT and Flash Builder were built around it. The use of workspaces, once you get your head around them, is powerful for focusing your head on the work at hand, keeping all associated projects within the one space. However there are times [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F844"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F844&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I've been a fan of Eclipse for a long time now, even before FDT and Flash Builder were built around it. The use of workspaces, once you get your head around them, is powerful for focusing your head on the work at hand, keeping all associated projects within the one space.</p>
<p>However there are times when I wish I was able to have multiple workspaces open. And too the rescue comes the command line.<br />
<span id="more-844"></span></p>
<pre>[Path/To/Eclipse]/eclipse -data [Your/Workspace/Dir] &
</pre>
<p><br/><br />
I've wrapped this up into a little bash script to start eclipse from either the current directory or using the specified directory as the workspace:</p>
<pre class="bash"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">#!/bin/sh</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> -n <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Starting eclipse: WORKSPACE: &quot;</span> $<span style="color: #000000;">1</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	/Applications/eclipse/eclipse  -data $<span style="color: #000000;">1</span> &amp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">else</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Starting eclipse: WORKSPACE: &quot;</span> `<span style="color: #7a0874; font-weight: bold;">pwd</span>`</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	/Applications/eclipse/eclipse  -data `<span style="color: #7a0874; font-weight: bold;">pwd</span>` &amp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">fi</span></div></li></ol></pre>
<p><br/></p>
<p>On OSX it's better to use the open command, like:</p>
<pre class="bash"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">#!/bin/sh</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> -n <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Starting eclipse: WORKSPACE: &quot;</span> $<span style="color: #000000;">1</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	open -n /Applications/eclipse/Eclipse.app --args  -data $<span style="color: #000000;">1</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">else</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Starting eclipse: WORKSPACE: &quot;</span> `<span style="color: #7a0874; font-weight: bold;">pwd</span>`</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	open -n /Applications/eclipse/Eclipse.app --args  -data `<span style="color: #7a0874; font-weight: bold;">pwd</span>`</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">fi</span></div></li></ol></pre>
<p><br/><br />
This will work equally as well with the Flash Builder application, just replace the Eclipse.app with the path to Flash Builder.</p>
<p>Happy workspacing!</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/844"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/844/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSX Apache and Mod_ssl</title>
		<link>http://labs.distriqt.com/post/345</link>
		<comments>http://labs.distriqt.com/post/345#comments</comments>
		<pubDate>Wed, 01 Sep 2010 06:41:05 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=345</guid>
		<description><![CDATA[This one always gets me. Seems so difficult on OSX (Snow Leopard), so for all those who are trying to get https on the base install of apache(2) in snow leopard here are some tips. Self signed SSL Cert generation in a terminal type: openssl genrsa -des3 -out server.key 1024openssl req -new -key server.key -out [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F345"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F345&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>This one always gets me. Seems so difficult on OSX (Snow Leopard), so for all those who are trying to get https on the base install of apache(2) in snow leopard here are some tips.<br />
<span id="more-345"></span><br />
Self signed SSL Cert generation in a terminal type:</p>
<pre class="bash"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">openssl genrsa -des3 -out server.key <span style="color: #000000;">1024</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">openssl req -new -key server.key -out server.csr</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">openssl x509 -req -days <span style="color: #000000;">3650</span> -<span style="color: #000000; font-weight: bold;">in</span> server.csr -signkey server.key -out server.crt</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #c20cb9; font-weight: bold;">cp</span> server.key server.key.bak</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">openssl rsa -<span style="color: #000000; font-weight: bold;">in</span> server.key.bak -out server.key</div></li></ol></pre>
<p>The defaults are fine for a development environment, but of course you can enter in specifics if you need. I do recommend at least entering a common name (CN) though. You'll have to enter in a pass phrase in the first line and again in some of the subsequent commands.</p>
<p>Once you've run this you'll end up with the two all important files, the ssl certificate file (server.crt) and the ssl certificate key file (server.key). You need to point the apache configuration to these files.</p>
<p><code>sudo vim /etc/apache2/extra/httpd-ssl.conf</code></p>
<p>Find and edit the two lines below, to point to the files you generated above:</p>
<pre class="bash"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">SSLCertificateFile <span style="color: #ff0000;">&quot;/private/etc/apache2/server.crt&quot;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">SSLCertificateKeyFile <span style="color: #ff0000;">&quot;/private/etc/apache2/server.key&quot;</span></div></li></ol></pre>
<p>Next check that the mod ssl and ssl configuration is included in your apache configuration:</p>
<p><code>sudo vim /etc/apache2/httpd.conf</code></p>
<p>And check the following lines exist and aren't commented out: </p>
<pre class="bash"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">LoadModule ssl_module libexec/apache2/mod_ssl.so</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Include /private/etc/apache2/extra/httpd-ssl.conf</div></li></ol></pre>
<p>And finally you'll need to restart apache to get the new configuration loaded.</p>
<p><code>sudo apachectl restart</code></p>
<p>And that should be it, you should now be able to browse to <a href="https://localhost/">https://localhost/</a>. As it is a self signed certificate expect to click through a few warnings.</p>
<p>Happy SSLing.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/345"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/345/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finder and Terminal</title>
		<link>http://labs.distriqt.com/post/364</link>
		<comments>http://labs.distriqt.com/post/364#comments</comments>
		<pubDate>Wed, 25 Aug 2010 05:57:23 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=364</guid>
		<description><![CDATA[Here we'll show you how to move the present working directory of a Terminal window to the current directory in the front most Finder window. I'm sure you're aware of the terminal command open . which opens a Finder window in the current directory of your Terminal window. And of course there are equivalent plugins [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F364"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F364&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Here we'll show you how to move the present working directory of a Terminal window to the current directory in the front most Finder window.<br />
<span id="more-364"></span><br />
I'm sure you're aware of the terminal command </p>
<p><code>open .</code></p>
<p>which opens a Finder window in the current directory of your Terminal window. And of course there are equivalent plugins to open a terminal window from finder:</p>
<ul>
<li><a href="http://jo.irisson.free.fr/?p=59">Open Terminal Here</a></li>
<li><a href="http://code.google.com/p/cdto/">cdtop</a></li>
</ul>
<p>Both of them allow you to place a Finder Toolbar button to open a Terminal window.</p>
<p>But my new favourite is a script that changes your present working directory to that of the front most Finder window. Thanks to users at <a href="http://stackoverflow.com/questions/420456/open-terminal-here-in-mac-os-finder">stackoverflow</a> for this. This rocks for jumping around the file structure, especially if you've just browsed somewhere through finder and need to run a script in the directory. </p>
<p>Drop these functions into your <code>.bash_profile</code> using vim or other:</p>
<pre class="bash"><span style="color: #000000; font-weight: bold;">function</span> ff <span style="color: #7a0874; font-weight: bold;">&#123;</span> osascript -e <span style="color: #ff0000;">'tell application &quot;Finder&quot;'</span>\
	-e <span style="color: #ff0000;">&quot;if (${1-1} &lt;= (count Finder windows)) then&quot;</span>\
	-e <span style="color: #ff0000;">&quot;get POSIX path of (target of window ${1-1} as alias)&quot;</span>\
	-e <span style="color: #ff0000;">'else'</span> -e <span style="color: #ff0000;">'get POSIX path of (desktop as alias)'</span>\
	-e <span style="color: #ff0000;">'end if'</span> -e <span style="color: #ff0000;">'end tell'</span>; <span style="color: #7a0874; font-weight: bold;">&#125;</span>;\
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> cdff <span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #ff0000;">&quot;`ff $@`&quot;</span>; <span style="color: #7a0874; font-weight: bold;">&#125;</span>;
&nbsp;</pre>
<p>Then you can type <code>cdff</code> to change to the front most finder directory. Awesomely powerful!</p>
<p>Happy Terminaling...</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/364"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/364/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 on the Command Line</title>
		<link>http://labs.distriqt.com/post/80</link>
		<comments>http://labs.distriqt.com/post/80#comments</comments>
		<pubDate>Wed, 01 Jul 2009 01:26:03 +0000</pubDate>
		<dc:creator>Michael Archbold</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://labs.distriqt.com/?p=80</guid>
		<description><![CDATA[As anyone who knows me would tell you, I live by the command line, so I thought I would share my newest trick to compile as3 applications from bash.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F80"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flabs.distriqt.com%2Fpost%2F80&amp;source=distriqt&amp;style=normal&amp;service=bit.ly&amp;service_api=R_d2c0f1a5509cd228ab0be545d628ad7a&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>As anyone who knows me would tell you, I live by the command line, so I thought I would share an old trick to compile as3 applications from the command line in bash.</p>
<p>The trick here is to use the Flex SDK compiler which is available free from Adobe. It also requires having installed <a href="http://www.java.com/" target="_blank">java</a>, which is so common on most machines that I won't talk about installation.</p>
<p>The setup process is fairly simple:</p>
<ul>
<li>Grab Flex SDK: <a href="http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK" target="_blank">http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK</a> </li>
<li>Extract to a location, eg: <code>~/.flex</code></li>
<li>Make executable: <code>chmod +x ~/.flex/bin/compc ~/.flex/bin/mxmlc</code></li>
<li>Add the location to your path in .bashrc: <code>PATH=~/.flex/bin:"${PATH}"</code></li>
</ul>
<p>Once that's done you should be able to type <code>mxmlc</code> into the command line and see an error stating you must specify a target file. To compile an as3 file simply use the following:</p>
<pre><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mxmlc main-app-file.as -o output.swf</div></li></ol></pre>
<p>Additionally I compile my libraries to my-libs.swc by doing the following:
</p>
<pre><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">compc -source-path . -include-sources . -output my-libs.swc</div></li></ol></pre>
<p>Since this is a flex compile you can also use flex syntax in your actionscript to embed resources in the code. Most commonly I use the swf definition line below to simply definite the frame rate and dimensions of the compiled output.
</p>
<pre><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">[SWF(width='990',height='680',backgroundColor='0x000000', frameRate='30')]</div></li></ol></pre>
<p><br/></p>
<hr/>
<br/></p>
<p>Now to use Flash CS3's V3 Components see this post: <a href="http://www.moock.org/blog/archives/000253.html" >moock.org</a></p>
<p>Additionally there are Eclipse tools for actionscript: <a href="http://www.kintespace.com/rasxlog/?p=784" >the rasx() context</a></p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://labs.distriqt.com/post/80"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://labs.distriqt.com/post/80/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

