<?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>Blog.ubrious &#187; Mac OS X</title>
	<atom:link href="http://blog.ubrio.us/tag/osx/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ubrio.us</link>
	<description>An Ordinary Web Developer's Blog</description>
	<lastBuildDate>Thu, 19 Jan 2012 00:44:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>OSX, RubyGems and cross-thread violations in rb_gc</title>
		<link>http://blog.ubrio.us/nix/osx-rubygems-and-cross-thread-violations-in-rb_gc/</link>
		<comments>http://blog.ubrio.us/nix/osx-rubygems-and-cross-thread-violations-in-rb_gc/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 15:37:40 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[gems]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/?p=104</guid>
		<description><![CDATA[I recently decided to migrate away from OSX&#8217;s default ruby install yesterday and noticed a few quirky hangups. Firstly, for some reason, and I&#8217;m not sure if it is just me or not, OSX&#8217;s default $PATH variable is putting /usr/local/bin AFTER /bin making your local installs not enabled by default. (Editing the /etc/paths didn&#8217;t do [...]]]></description>
			<content:encoded><![CDATA[<p>I recently decided to migrate away from OSX&#8217;s default ruby install yesterday and noticed a few quirky hangups. Firstly, for some reason, and I&#8217;m not sure if it is just me or not, OSX&#8217;s default $PATH variable is putting /usr/local/bin AFTER /bin making your local installs not enabled by default. (Editing the /etc/paths didn&#8217;t do the trick so I manually added it to PATH).</p>
<p>The installation went easily for both ruby gems and ruby, but I decided to take a &#8217;short cut&#8217; and copy all my gems from /Library/Ruby/Gems into my /usr/local/lib directory which started raising all kinds of errors &#8212; this one, in particular was obnoxious.</p>
<p><code>[BUG] cross-thread violation on rb_gc()</code></p>
<p>Luckily, all that means is that I copied over gems which were compiled against the standard OSX ruby version and not the new one. This was a little script I wrote which will show you which gems need to be re-compiled. Just <tt>cd</tt> over to your /usr/local/lib/ruby/gems/1.8/gems directory and run:</p>
<p><code><span>gems $></span>ls -1 **/**/*.bundle|ruby -pe '$_.gsub! /\-.*/, ""'|uniq</code></p>
<p>to get a list, or pipe that into <code><span>$></span> sudo gem install</code> and that should clear up those gc issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/nix/osx-rubygems-and-cross-thread-violations-in-rb_gc/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>OSX Terminal Niceties for Remote Servers</title>
		<link>http://blog.ubrio.us/nix/osx-terminal-niceties-for-remote-servers/</link>
		<comments>http://blog.ubrio.us/nix/osx-terminal-niceties-for-remote-servers/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 20:46:56 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[bashrc]]></category>
		<category><![CDATA[nano]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/osx/osx-terminal-niceties-for-remote-servers/</guid>
		<description><![CDATA[I have absolutely no idea what to title this as &#8212; and frankly, its more for me than anyone else. I need a place to store this before I forget and go racking my brain 2 years from now on how to do this.
If you think you&#8217;re interested &#8212; this post is about the following:

How [...]]]></description>
			<content:encoded><![CDATA[<p>I have absolutely no idea what to title this as &#8212; and frankly, its more for me than anyone else. I need a place to store this before I forget and go racking my brain 2 years from now on how to do this.</p>
<h5>If you think you&#8217;re interested &#8212; this post is about the following:</h5>
<ol>
<li>How to get your current user/directory in the title of terminal (iTerm.app for this post &#8212; same applies for Terminal.app though)</li>
<li>How to make the backspace/delete keys work properly in nano/pico on local and remote servers</li>
<li>Update your current user/path in the title when you SSH into a remote machine</li>
<li>And how to setup password-less SSH, just because its on topic</li>
</ol>
<h3>.bashrc modifications</h3>
<p>Making Terminal.app&#8217;s title update to the current user &#038; path for both local and remote servers while letting the backspace and delete key work properly &#8212; all in one solution! <img src='http://blog.ubrio.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class='tip'>Get yourself a nifty shell prompt over here -><a href="http://blog.ubrio.us/osx/best-bash-prompt/">Bash Prompt Madness</a></div>
<h5>Add the following lines to both your local &#038; remote .bashrc</h5>
<pre class="brush: ruby;">
# this is what updates your Terminal's title -- you can of course modify this
# but im not explaining how -- google it
export PROMPT_COMMAND='echo -ne &quot;\\033]0;${USER}:${PWD}\\007&quot;'

# this will make OSXs backspace &amp; delete keys work properly
# in nano &amp; pico
export TERM=xterm
stty erase ^H

# fancy prompt you say?
# again -- google for more info on this
export PS1=&quot;\\[\\033[0;34m\\][\\!]\[\\033[0;32m\\][\\u.\\h: \\w]\[\\033[0;32m\\]\\$\\[\\033[0m\\] &quot;

#gives you something like:
# [0][rob.hades: ~]$ echo 'hello world!'
</pre>
<h5>Now lets bind our servers for SSH so we don&#8217;t need passwords</h5>
<p>Passwords are annoying &#8212; especially when you are using <a href="http://en.wikipedia.org/wiki/Secure_copy" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Secure_copy?referer=');">scp</a> and <a href="http://en.wikipedia.org/wiki/Rsync" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Rsync?referer=');">rsync</a> a lot.</p>
<p>Here is a very simple way to drop those passwords and have SSH do all the work.</p>
<h6>In your terminal app (Locally)</h6>
<p>Make your .ssh directory<br />
<code><span>$></span>mkdir -p ~/.ssh &#038;&#038; cd ~/.ssh</code></p>
<p>Generate yourself some keys<br />
<code><span>~/.ssh $></span>ssh-keygen -t dsa -f ~/.ssh/id_dsa</code></p>
<p>Copy your public key to your remote server (Make sure the remote server has a ~/.ssh directory as well!)<br />
<code><span>~/.ssh $></span>scp id_dsa.pub {user}@{remoteserver}:.ssh</code></p>
<h6>In the remote computer</h6>
<p>Add that public key to your authorized_keys file for SSH<br />
<code><span>$></span>cd .ssh &#038;&#038; cat id_dsa.pub >> authorized_keys2</code></p>
<p>Cleanup those files and make sure the authorized_keys file is set to the right perms.<br />
<code><span>~/.ssh $></span>chmod 640 authorized_keys2 &#038;&#038; rm id_dsa.pub</code></p>
<p>That should make your life a bit more convenient <img src='http://blog.ubrio.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/nix/osx-terminal-niceties-for-remote-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prepend files in OS X using the Command Line</title>
		<link>http://blog.ubrio.us/code/prepend-files-in-os-x-using-the-command-line/</link>
		<comments>http://blog.ubrio.us/code/prepend-files-in-os-x-using-the-command-line/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 05:16:46 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Nix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/osx/prepend-files-in-os-x-using-the-command-line/</guid>
		<description><![CDATA[This is a neat little &#8220;trick&#8221; to prepend something simple to the beginning of a file. Linux is funny in the way that you can easily append to a file by using echo "append me to the file" >> FILE but theres no real simple way to prepend. Most snippets I&#8217;ve seen use a tmp [...]]]></description>
			<content:encoded><![CDATA[<p>This is a neat little &#8220;trick&#8221; to prepend something simple to the beginning of a file. Linux is funny in the way that you can easily append to a file by using <code>echo "append me to the file" >> FILE</code> but theres no real simple way to prepend. Most snippets I&#8217;ve seen use a tmp file but thats silly when OS X gives you some amazing programs. </p>
<p>Using <code>pbcopy</code> and <code>pbpaste</code> can save your life sometimes and are probably one programs I miss the most when using Linux. Anyway, heres just a simple &#8220;1 liner&#8221; for prepending.</p>
<p><code class='prettyprint'>cat FILE | pbcopy &#038;&#038; echo "Prepend Text" > FILE &#038;&#038; pbpaste >> FILE</code></p>
<p>Pretty simple, but it can be useful at times &#8212; like when you have a script that would be better off with a shebang line than being run by hand and you&#8217;re too lazy to open an editor.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/code/prepend-files-in-os-x-using-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP5 With GD Support on OS X</title>
		<link>http://blog.ubrio.us/php/php5-with-gd-support-on-os-x/</link>
		<comments>http://blog.ubrio.us/php/php5-with-gd-support-on-os-x/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 02:39:15 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Because I'll Forget]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[gd]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/because-ill-forget/php5-with-gd-support-on-os-x/</guid>
		<description><![CDATA[Because I&#8217;ll Forget #15901:
Firstly, let me just say that compiling PHP has never been this difficult before. It shouldn&#8217;t be difficult at all actually. So heres the basic run down: I need SOAP, GD, SimpleXML and a few other miscellaneous extensions to make all my dev apps work properly &#8212; this went smoothly on the [...]]]></description>
			<content:encoded><![CDATA[<h3>Because I&#8217;ll Forget #15901:</h3>
<p>Firstly, let me just say that compiling PHP has never been this difficult before. It shouldn&#8217;t be difficult at all actually. So heres the basic run down: I need SOAP, GD, SimpleXML and a few other miscellaneous extensions to make all my dev apps work properly &#8212; this went smoothly on the ppc laptop, and I (stupidly) assumed that the Intel would be even easier. My first couple attempts were splattered with GD errors driving me to the brink of insanity as I scrambled up all the pre-requisites. Finally, I had all dependencies met and the configure script STILL would not quit barfing on me. I gave up and finally just installed PHP without GD support (naturally ruining the one project I&#8217;m working on currently). I gave up, until I felt feisty enough to give it another shot.</p>
<p>The configure script was choking on a linking error (<strong>GD build test failed. Please check the config.log for details.</strong>) and kept telling me to hunt config.log for some answers. It turns out that ./configure was attempting to link with shell variables that were empty. </p>
<p>Looks something like &#8220;<code>-L: directory name missing</code>&#8220;.</p>
<p><strong>The solution</strong></p>
<p>Hacking my way through the configure file you get to the culprit. </p>
<p><code class='prettyprint'>LIBS=" -L$GD_LIB $GD_SHARED_LIBADD  $LIBS"</code></p>
<p>Turns out that <code>echo $GD_LIB</code> is blank and being a major pain in the ass. To fix this, just edit the line to look more like: <code>LIBS=" $GD_SHARED_LIBADD  $LIBS"</code>. After that, try a <code>make clean</code>, <code>rm config.cache</code> and try to compile again.  Hopefully this will save you a couple hours of hating life.</p>
<p><strong>Resources:</strong></p>
<ul>
<li><a href="http://www.phpmac.com/articles.php?view=3" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.phpmac.com/articles.php?view=3&amp;referer=');">http://www.phpmac.com/articles.php?view=3</a> &#8212; good instructions for getting those GD dependencies.</li>
<li><a href="http://www.phpmac.com/articles.php?view=159" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.phpmac.com/articles.php?view=159&amp;referer=');">http://www.phpmac.com/articles.php?view=159</a> &#8212; more insight from the same site</li>
<li><a href="http://www.afp548.com/article.php?story=20041104230209410" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.afp548.com/article.php?story=20041104230209410&amp;referer=');">http://www.afp548.com/article.php?story=20041104230209410</a> &#8212; more about GD dependencies, and a little more insight into problems</li>
<li><a href="http://www.thescripts.com/forum/thread670263.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.thescripts.com/forum/thread670263.html?referer=');">http://www.thescripts.com/forum/thread670263.html</a> &#8212; explains the final solution in more depth</li>
</ul>
<p><strong>My Configure Script</strong><br />
<small>It might be beefed up in the future, but I&#8217;m just relieved to have it compiled &#038; working right now &#8212; I&#8217;m exhausted</small></p>
<pre class='prettyprint'>
./configure --prefix=/usr/local/php5 \
 --mandir=/usr/share/man \
 --infodir=/usr/share/info \
 --sysconfdir=/etc \
 --enable-cli \
 --enable-soap \
 --with-ldap=/usr \
 --with-xml \
 --with-libxml-dir=/usr/local \
 --with-zlib \
 --with-zlib-dir=/usr \
 --with-openssl \
 --enable-exif \
 --enable-ftp \
 --enable-mbstring \
 --enable-mbregex \
 --enable-dbx \
 --enable-sockets \
 --with-curl=/usr \
 --with-mysql=/usr/local/mysql \
 --with-mysqli=/usr/local/mysql/bin/mysql_config \
 --with-apxs \
 --with-gd \
 --with-jpeg-dir=/usr \
 --with-png-dir=/usr \
 --with-freetype-dir=/usr \
 --with-xpm-dir=/usr
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/php/php5-with-gd-support-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create icon sets in OS X</title>
		<link>http://blog.ubrio.us/osx/how-to-create-icon-sets-in-os-x/</link>
		<comments>http://blog.ubrio.us/osx/how-to-create-icon-sets-in-os-x/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 00:54:35 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Because I'll Forget]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[icons]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/because-ill-forget/how-to-create-icon-sets-in-os-x/</guid>
		<description><![CDATA[Because I&#8217;ll Forget #1023:
Problem
I know how to _USE_ icon sets and set my icons*. My issue is that I want to take a folder of, say, *.PNG files and make the icon reflect the contents. I did some digging, and the solution is pretty simple &#8212; AND elegant.
Solution
There is a relatively unknown program, at least [...]]]></description>
			<content:encoded><![CDATA[<h3>Because I&#8217;ll Forget #1023:</h3>
<p><strong>Problem</strong><br />
I know how to _USE_ icon sets and set my icons*. My issue is that I want to take a folder of, say, *.PNG files and make the icon reflect the contents. I did some digging, and the solution is pretty simple &#8212; AND elegant.</p>
<p><strong>Solution</strong><br />
There is a relatively unknown program, at least it was to me, called &#8220;sips.&#8221; To take the generic PNG icon and replace it with a small thumbnail of the actual image you simply run <code>sips -i {image.ext}</code> from the command line. Beautiful!</p>
<p><strong>Example</strong></p>
<ol>
<li>Open a shell</li>
<li>cd {folder full of icons here}</li>
<li><code>find . -name "*.{ext}" -exec sips -i '{}' \;</code></li>
<li>Wait&#8230;</li>
<li>Start at the top of this page with how to change icons</li>
</ol>
<p><strong>Resources</strong></p>
<ul>
<li><a href="http://forums.macosxhints.com/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/forums.macosxhints.com/?referer=');">http://forums.macosxhints.com/</a></li>
</ul>
<hr noshade/>
<small>*opt-cmd-i anything, select source, copy icon, select desc, paste</small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/osx/how-to-create-icon-sets-in-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>One Click Image Resizing on OS X With Preview and Automator</title>
		<link>http://blog.ubrio.us/osx/one-click-image-resizing-on-os-x-with-preview-and-automator/</link>
		<comments>http://blog.ubrio.us/osx/one-click-image-resizing-on-os-x-with-preview-and-automator/#comments</comments>
		<pubDate>Fri, 18 May 2007 15:14:20 +0000</pubDate>
		<dc:creator>Rob Hurring</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[automator]]></category>

		<guid isPermaLink="false">http://blog.ubrio.us/osx/one-click-image-resizing-on-os-x-with-preview-and-automator/</guid>
		<description><![CDATA[Problem
Well. As you can see I&#8217;ve been making screenshots lately, and, as always, putting a large picture in a blog is a bad idea. My normal process was to drag it into photoshop, resize it to around 30% and save a copy. Thats a major waste of time considering the Photoshop startup isn&#8217;t exactly lightning [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
Well. As you can see I&#8217;ve been making screenshots lately, and, as always, putting a large picture in a blog is a bad idea. My normal process was to drag it into photoshop, resize it to around 30% and save a copy. Thats a major waste of time considering the Photoshop startup isn&#8217;t exactly lightning on this laptop.</p>
<p><strong>Solution</strong><br />
After some digging around, I found a nice article from <a href="http://jes.blogs.shellprompt.net/2007/02/25/using-automator-actions/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/jes.blogs.shellprompt.net/2007/02/25/using-automator-actions/?referer=');">John&#8217;s Blog</a> on using automator for this task.  Surprisingly, it is easy to do &#8211; just a few steps to save you countless seconds of Photoshop splash-screen torture.</p>
<p><strong>How-To</strong></p>
<ul>
<li>Fire up Automator</li>
<li>Under the Applications list, choose Finder</li>
<li>Under the Finder actions list, choose Get Selected Finder Items</li>
<li>Under the Applications list, choose Preview</li>
<li>Under the Preview actions list, choose Scale Images</li>
<li>Select &#8216;Show Actions When Run&#8217; under the Options drop-down</li>
<li>Save as a Plug-In</li>
</ul>
<p><em>(Click for larger size)</em><br />
<a href="http://pic.ubrio.us/blog_images/automator_01.png" rel="lightbox" title="Your workflow should look something like this" onclick="pageTracker._trackPageview('/outgoing/pic.ubrio.us/blog_images/automator_01.png?referer=');"><img src="http://pic.ubrio.us/blog_images/thumb_automator_01.png" /></a></p>
<p><strong>Usage</strong><br />
Take a quick screenshot (cmd-shift-3). Now, currently it is setup so that it will resize the original file. I like this since it gives me control of how I want to manipulate the image &#8212; for example, if I need a thumbnail I can simply option-drag to copy, and resize.</p>
<p>Right-click the &#8216;Picture X&#8217; and under the Automator menu you should see your Automator plug-in. Click that, and viola! Done.</p>
<p><em>(Dialog that pops up)</em><br />
<img src="http://pic.ubrio.us/blog_images/automator_dialog.png" /></p>
<p>Hopefully this saves someone the trouble of opening Photoshop for something as simple as scaling an image.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ubrio.us/osx/one-click-image-resizing-on-os-x-with-preview-and-automator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

