<?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>langui.sh &#187; mac</title>
	<atom:link href="http://langui.sh/tag/mac/feed/" rel="self" type="application/rss+xml" />
	<link>http://langui.sh</link>
	<description>Fun hacks, WP plugins, photography, and PKI junk.  Languishing since 2008.</description>
	<lastBuildDate>Tue, 20 Jul 2010 22:12:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Fixing GrowlMail in 10.6.4 (Mail 4.3)</title>
		<link>http://langui.sh/2010/06/15/fixing-growlmail-in-10-6-4-mail-4-3/</link>
		<comments>http://langui.sh/2010/06/15/fixing-growlmail-in-10-6-4-mail-4-3/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 21:41:17 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[growlmail]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mail]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1129</guid>
		<description><![CDATA[Another OS X release, another broken GrowlMail bundle. I did a post just like this for 10.6.2. Check it out if you want more background on why this occurs. Easy Fix Download a pre-patched GrowlMail.bundle and drop it in your ~/Library/Mail/Bundles/ directory1. If you want it available to multiple users on your system, use /Library/Mail/Bundles/. [...]]]></description>
			<content:encoded><![CDATA[<p>Another OS X release, another broken GrowlMail bundle.  I did a post just like this for 10.6.2.  <a href="/2009/11/09/fixing-growlmail-letterbox-for-mail-4-2/" target="_blank">Check it out</a> if you want more background on why this occurs.</p>
<h3>Easy Fix</h3>
<p>Download a pre-patched GrowlMail.bundle and drop it in your ~/Library/Mail/Bundles/ directory<sup class='footnote'><a href='#fn-1129-1' id='fnref-1129-1'>1</a></sup>.  If you want it available to multiple users on your system, use /Library/Mail/Bundles/.</p>
<p><b><a href="http://cdn.langui.sh/2010/06/GrowlMail.mailbundle.zip">Download patched bundle</a></b></p>
<p>If you use this method you&#8217;re all set; no need to use the command line solution below.</p>
<h3>Add New UUIDs to SupportedPluginCompatibilityUUIDs</h3>
<p>If you have already had your plugins disabled by opening Mail.app you&#8217;ll need to look in ~/Library/Mail (or /Library/Mail if you installed globally) and move the files back to the active bundles directory.  They&#8217;ll typically be in Bundles (Disabled), so quit Mail, find them, and move them back into the proper directory.</p>
<p>If you have a local installation:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Mail<span style="color: #000000; font-weight: bold;">/</span>Bundles<span style="color: #000000; font-weight: bold;">/</span>GrowlMail.mailbundle<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>Info SupportedPluginCompatibilityUUIDs <span style="color: #660033;">-array-add</span> <span style="color: #ff0000;">&quot;E71BD599-351A-42C5-9B63-EA5C47F7CE8E&quot;</span>
defaults <span style="color: #c20cb9; font-weight: bold;">write</span> ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Mail<span style="color: #000000; font-weight: bold;">/</span>Bundles<span style="color: #000000; font-weight: bold;">/</span>GrowlMail.mailbundle<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>Info SupportedPluginCompatibilityUUIDs <span style="color: #660033;">-array-add</span> <span style="color: #ff0000;">&quot;B842F7D0-4D81-4DDF-A672-129CA5B32D57&quot;</span></pre></div></div>

<p>Global installation:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Mail<span style="color: #000000; font-weight: bold;">/</span>Bundles<span style="color: #000000; font-weight: bold;">/</span>GrowlMail.mailbundle<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>Info SupportedPluginCompatibilityUUIDs <span style="color: #660033;">-array-add</span> <span style="color: #ff0000;">&quot;E71BD599-351A-42C5-9B63-EA5C47F7CE8E&quot;</span>
defaults <span style="color: #c20cb9; font-weight: bold;">write</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Mail<span style="color: #000000; font-weight: bold;">/</span>Bundles<span style="color: #000000; font-weight: bold;">/</span>GrowlMail.mailbundle<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>Info SupportedPluginCompatibilityUUIDs <span style="color: #660033;">-array-add</span> <span style="color: #ff0000;">&quot;B842F7D0-4D81-4DDF-A672-129CA5B32D57&quot;</span></pre></div></div>

<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-1129-1'>~ means your home directory if you&#8217;re unfamiliar with the syntax. You can click the home icon on your Finder sidebar if you&#8217;re still confused <span class='footnotereverse'><a href='#fnref-1129-1'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2010/06/15/fixing-growlmail-in-10-6-4-mail-4-3/feed/</wfw:commentRss>
		<slash:comments>75</slash:comments>
		</item>
		<item>
		<title>No Interfaces Available In Wireshark Mac OS X</title>
		<link>http://langui.sh/2010/01/31/no-interfaces-available-in-wireshark-mac-os-x/</link>
		<comments>http://langui.sh/2010/01/31/no-interfaces-available-in-wireshark-mac-os-x/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 22:36:11 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1082</guid>
		<description><![CDATA[Many new Wireshark users on Mac OS X run into an issue where no interfaces show up when trying to begin packet capture. If you attempt to manually input an interface (such as en0) this error will occur: The capture session could not be initiated ((no devices found) /dev/bpf0: Permission denied). To have the interfaces [...]]]></description>
			<content:encoded><![CDATA[<p>Many new Wireshark users on Mac OS X run into an issue where no interfaces show up when trying to begin packet capture.  If you attempt to manually input an interface (such as en0) this error will occur:</p>
<blockquote><p> The capture session could not be initiated ((no devices found) /dev/bpf0: Permission denied).</p></blockquote>
<p>To have the interfaces show up properly you&#8217;ll need to widen the permissions on the Berkeley packet filter (BPF).  By default they look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">crw-------  <span style="color: #000000;">1</span> root  wheel   <span style="color: #000000;">23</span>,   <span style="color: #000000;">0</span> Jan <span style="color: #000000;">31</span> <span style="color: #000000;">13</span>:<span style="color: #000000;">47</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>bpf0</pre></div></div>

<p>We need the filter to be readable by non-root, so open Terminal.app and run this command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">644</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>bpf<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>Unfortunately every time you reboot this will reset, but if you are a frequent user of Wireshark you can add the ChmodBPF StartupItem to alter them automatically (available in the Utilities folder on the Wireshark disk image).  To install you&#8217;ll need to follow two steps.</p>
<p>First, drag the ChmodBPF folder to the StartupItems alias in the same folder (or drag it to /Library/StartupItems directly).  Type your password to authenticate and move the folder into the correct location.</p>
<p>The second requirement is only for 10.6+ users.  Starting with Snow Leopard the security permissions of StartupItems are being enforced.  Scripts that do not have the proper owner and group will receive this error:</p>
<blockquote><p> Insecure Startup Item disabled. – “/Library/StartupItems/ChmodBPF” has not been started because it does not have the proper security settings</p></blockquote>
<p>The proper security settings are ownership of the scripts by root and group of wheel.<sup class='footnote'><a href='#fn-1082-1' id='fnref-1082-1'>1</a></sup>  To set them:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> root:wheel ChmodBPF</pre></div></div>

<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-1082-1'>The correct settings for startup items can be found in this <a href="http://support.apple.com/kb/HT2413" target="_blank">Apple KB article</a> <span class='footnotereverse'><a href='#fnref-1082-1'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2010/01/31/no-interfaces-available-in-wireshark-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Building Services Using Automator Workflows in Snow Leopard (10.6)</title>
		<link>http://langui.sh/2009/11/19/building-services-using-automator-workflows-in-snow-leopard-10-6/</link>
		<comments>http://langui.sh/2009/11/19/building-services-using-automator-workflows-in-snow-leopard-10-6/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 00:42:10 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[automator]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[services]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=775</guid>
		<description><![CDATA[In Snow Leopard (Mac OS X 10.6) the Automator tool has been drastically upgraded to support the creation of service workflows. In simple terms, this means you can build automated chains of tasks that can be invoked in a context sensitive manner. Not simple enough? Using this tool, you can automate common actions you perform [...]]]></description>
			<content:encoded><![CDATA[<p>In Snow Leopard (Mac OS X 10.6) the Automator tool has been drastically upgraded to support the creation of service workflows.  In simple terms, this means you can build automated chains of tasks that can be invoked in a context sensitive manner.  Not simple enough?  Using this tool, you can automate common actions you perform and the proper service will appear in the menu only when it is capable of being used.  You can even assign global hotkeys (via the Keyboard preference pane) to your service.  Let&#8217;s take a look at a simple service workflow so you can see how it&#8217;s done.</p>
<p>Open Automator (it&#8217;s located in your /Applications folder).  You will be greeted by a sheet requesting a template for your workflow.  Choose service.</p>
<p><a href="http://cdn.langui.sh/2009/11/choose_your_template.png"><img src="http://cdn.langui.sh/2009/11/choose_your_template-300x278.png" alt="choose_your_template" title="choose_your_template" width="300" height="278" class="aligncenter size-medium wp-image-857" /></a></p>
<p>You&#8217;ll now be greeted by the main Automator window.  On the left you&#8217;ll see a Library and actions you can perform.  On the right you&#8217;ll see an empty pane where you drag actions or files to build your workflow.  Third party applications you have installed can expose additional available actions, so the list of available actions will vary for each user&#8217;s computer.</p>
<p><a href="http://cdn.langui.sh/2009/11/main_window.png"><img src="http://cdn.langui.sh/2009/11/main_window-300x265.png" alt="main_window" title="main_window" width="300" height="265" class="aligncenter size-medium wp-image-860" /></a></p>
<p>As an example, we&#8217;re going to build a service that allows you to select files in the Finder, automatically zip them, and attach them to a new email.  To begin, change the drop down in the upper right from &#8220;text&#8221; to &#8220;files or folders&#8221; and change &#8220;any application&#8221; to &#8220;Finder&#8221;.  This means that the service we&#8217;re constructing will accept files or folders from the Finder as input.  Next we need to add our first action.  To accomplish this type &#8220;create&#8221; in the search field in the upper left of the actions pane.  This will live filter the available actions so you can more easily locate the &#8220;Create Archive&#8221; action.  Once you&#8217;ve found it, drag and drop it to the right hand side.</p>
<p>After creating the zip archive we want to attach it to a mail message.  Search for &#8220;new mail message&#8221; and drag and drop it below the first action.  It will prompt you with a few dialogs (mostly for permissions to access your keychain), but when you&#8217;re done you should have the workflow below.</p>
<p><a href="http://cdn.langui.sh/2009/11/prelim_workflow.png"><img src="http://cdn.langui.sh/2009/11/prelim_workflow-300x247.png" alt="prelim_workflow" title="prelim_workflow" width="300" height="247" class="aligncenter size-medium wp-image-862" /></a></p>
<p>To test you can click Run, but you&#8217;ll receive a warning that states &#8220;This service will not receive input when run inside Automator.  To test this service within Automator, add the “Get Specified Finder Items” action to the beginning of your workflow. Remove or disable the action before running the workflow outside of Automator.&#8221;.  Hit cancel (there&#8217;s no point to running our service without input!) and add the &#8220;Get Specified Finder Items&#8221; action to the very top of your workflow.  You&#8217;ll also need to add an item or two for testing.</p>
<p><a href="http://cdn.langui.sh/2009/11/get_specified.png"><img src="http://cdn.langui.sh/2009/11/get_specified-300x247.png" alt="get_specified" title="get_specified" width="300" height="247" class="aligncenter size-medium wp-image-858" /></a></p>
<p>To test the entire service, click Run in the upper right!  You should see it create a zip file in the same directory as whatever files you specified, then open a new Mail message with your zip file attached.</p>
<p>If everything is working you can remove or disable the &#8220;Get Specified Finder Items&#8221; action and save your new service.  Whatever you name it will be how it appears in your Services menu, so try to give it a descriptive name (something like &#8220;Create Zip and Email&#8221;).  Now head to the Finder, select a file or folder, and click the Finder menu to see the Services submenu.</p>
<p><a href="http://cdn.langui.sh/2009/11/services_menu.png"><img src="http://cdn.langui.sh/2009/11/services_menu-300x117.png" alt="services_menu" title="services_menu" width="300" height="117" class="aligncenter size-medium wp-image-863" /></a></p>
<p>Success!</p>
<p>But what if you don&#8217;t want to use that submenu?  OS X allows you to assign global shortcuts/hotkeys to any Service using the Keyboard preference pane in System Preferences.  Go to Keyboard Shortcuts within it, click the services option on the left, then find your &#8220;Create Zip and Email&#8221; option on the right.  To add a shortcut you&#8217;ll need to double click on the righthand side of the Create Zip and Email row.  Once the text box appears, press the key combination you want to use to invoke this service.  Try to choose one that won&#8217;t conflict with anything.</p>
<p><a href="http://cdn.langui.sh/2009/11/keyboard_assigned.png"><img src="http://cdn.langui.sh/2009/11/keyboard_assigned-300x271.png" alt="keyboard_assigned" title="keyboard_assigned" width="300" height="271" class="aligncenter size-medium wp-image-859" /></a></p>
<p>Automator has a great deal of power, so try experimenting with various actions to build your own ideal workflow.  For example, I frequently parse SSL certificates in the course of my day, so I built this workflow to do it quickly and display the results in a text document in my editor of choice:</p>
<p><a href="http://cdn.langui.sh/2009/11/parse_cert.png"><img src="http://cdn.langui.sh/2009/11/parse_cert-290x300.png" alt="parse_cert" title="parse_cert" width="290" height="300" class="aligncenter size-medium wp-image-861" /></a></p>
<p>I also wanted a universal key combo to start the screensaver (which requires a password) so I could lock my computer quickly without using the mouse.</p>
<p><a href="http://cdn.langui.sh/2009/11/start_screensaver.png"><img src="http://cdn.langui.sh/2009/11/start_screensaver-291x300.png" alt="start_screensaver" title="start_screensaver" width="291" height="300" class="aligncenter size-medium wp-image-865" /></a></p>
<p>If you&#8217;ve got other service ideas or want to show off one of you&#8217;ve written drop a comment!  It&#8217;s always great to discover a better/more efficient way to accomplish a task.</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2009/11/19/building-services-using-automator-workflows-in-snow-leopard-10-6/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Bypass Hulu Regional Restrictions in Mac OS X</title>
		<link>http://langui.sh/2009/11/16/circumventing-hulu-regional-restrictions-in-mac-os-x/</link>
		<comments>http://langui.sh/2009/11/16/circumventing-hulu-regional-restrictions-in-mac-os-x/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 21:18:55 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[hulu]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=780</guid>
		<description><![CDATA[Hulu is a great site to find new shows and catch up on old, but due to various contracts no one outside the US can use it. This irritated some friends of mine from Canada, England, Germany, et cetera. So I decided to write up one (very reliable) way to circumvent the Hulu geolocation checks [...]]]></description>
			<content:encoded><![CDATA[<p>Hulu is a great site to find new shows and catch up on old, but due to various contracts no one outside the US can use it.  This irritated some friends of mine from Canada, England, Germany, et cetera.  So I decided to write up one (very reliable) way to circumvent the Hulu geolocation checks &#8212; using a VPN.<sup class='footnote'><a href='#fn-780-1' id='fnref-780-1'>1</a></sup></p>
<h3>Accessing Hulu Outside The US</h3>
<p>In this case, we&#8217;ll be using a small VM and the open source VPN server pptpd.  All the server side instructions below are applicable to both OS X and Windows, but the client setup is only specified for Mac OS X.</p>
<h3>Server Setup</h3>
<p>First, obtain a VM from a reputable (and fast) US vendor.  The VM must be located in the US since that&#8217;s our required origin.  I personally use <a href="http://www.slicehost.com">Slicehost</a>, but there are many others.  Once you get your login be sure you change the root password.</p>
<p>Install pptpd.  If you&#8217;re running on Ubuntu or Debian you can simply run</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> pptpd</pre></div></div>

<p>Once you have pptpd installed, we&#8217;ll need to add a user.  The default pptpd configuration is fine, but we&#8217;ll need to edit /etc/ppp/chap-secrets. When you edit the file (using vi, nano, emacs, et cetera) you&#8217;ll see this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Secrets for authentication using CHAP</span>
<span style="color: #666666; font-style: italic;"># client        server  secret                  IP addresses</span></pre></div></div>

<p>Client is your username, server is &#8220;pptpd&#8221;, secret is your password in plaintext, and IP addresses is a range of allowed IPs.  If you&#8217;re unconcerned about who might attempt to access your VPN, you can simply use a wildcard (*).  Once you&#8217;ve populated this file with data it will look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Secrets for authentication using CHAP</span>
<span style="color: #666666; font-style: italic;"># client	server	secret			IP addresses</span>
testuser	pptpd	mypassword		<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>We need to set up IPv4 forwarding, so edit /etc/sysctl.conf and uncomment the line below from the file (remove the #).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#net.ipv4.ip_forward=1</span></pre></div></div>

<p>This will enable the behavior after a reboot, but you can enable it right now by running:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>ip_forward</pre></div></div>

<p>Now run these commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-A</span> POSTROUTING <span style="color: #660033;">-o</span> eth0 <span style="color: #660033;">-j</span> MASQUERADE
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-i</span> eth0 <span style="color: #660033;">-o</span> ppp0 <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> RELATED,ESTABLISHED <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-i</span> ppp0 <span style="color: #660033;">-o</span> eth0 <span style="color: #660033;">-j</span> ACCEPT</pre></div></div>

<p>Once you&#8217;ve run these you can save them so they execute every time your VM boots by following <a href="http://rackerhacker.com/2009/11/16/automatically-loading-iptables-on-debianubuntu/">these quick instructions</a>.  This completes the server side setup.</p>
<h3>Client Setup</h3>
<p>Now it&#8217;s time to configure the Mac to utilize the VPN server.  Bear in mind that all traffic to the internet will be routed through your VPN server when this is active, so you&#8217;ll only want to connect to your VPN when watching Hulu.<sup class='footnote'><a href='#fn-780-2' id='fnref-780-2'>2</a></sup></p>
<p>Open System Preferences and go to Network.  Click the plus sign in the lower left and choose add to add a VPN PPTP interface.  Then set the server address (the IP of your VM) and account name (&#8220;testuser&#8221; from above).<br />
<a href="http://cdn.langui.sh/2009/11/network_screen.png"><img class="alignnone size-medium wp-image-836" title="network_screen" src="http://cdn.langui.sh/2009/11/network_screen-300x264.png" alt="network_screen" width="300" height="264" /></a></p>
<p>After filling out those fields, click authentication settings and type your password, then click Okay.</p>
<p><a href="http://cdn.langui.sh/2009/11/network_screen.png"></a><a href="http://cdn.langui.sh/2009/11/advanced.png"><img style="border: 0px initial initial;" title="advanced" src="http://cdn.langui.sh/2009/11/advanced-300x185.png" alt="advanced" width="300" height="185" /></a></p>
<p>Finally, click advanced, then click DNS and click the plus sign.  Add 4.2.2.1 as a DNS server.<sup class='footnote'><a href='#fn-780-3' id='fnref-780-3'>3</a></sup></p>
<p><a href="http://cdn.langui.sh/2009/11/advanced.png"></a><a href="http://cdn.langui.sh/2009/11/dns_fix.png"><img style="border: 0px initial initial;" title="dns_fix" src="http://cdn.langui.sh/2009/11/dns_fix-300x234.png" alt="dns_fix" width="300" height="234" /></a></p>
<p>Save these changes and then you can click connect to test it out.  Your traffic should all be routed through the VPN and since the endpoint is located in the US Hulu should work just fine!
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-780-1'>There are many other ways, including just proxying Hulu traffic from the browser and Flash plugin, but I&#8217;m not going to cover those methods. <span class='footnotereverse'><a href='#fnref-780-1'>&#8617;</a></span></li>
<li id='fn-780-2'> This can be alleviated by using a split tunnel if you want to go to the trouble. <span class='footnotereverse'><a href='#fnref-780-2'>&#8617;</a></span></li>
<li id='fn-780-3'>Our PPTP server doesn&#8217;t announce its own DNS by default. <span class='footnotereverse'><a href='#fnref-780-3'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2009/11/16/circumventing-hulu-regional-restrictions-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fixing GrowlMail for Mail 4.2</title>
		<link>http://langui.sh/2009/11/09/fixing-growlmail-letterbox-for-mail-4-2/</link>
		<comments>http://langui.sh/2009/11/09/fixing-growlmail-letterbox-for-mail-4-2/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 22:50:00 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mail]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=811</guid>
		<description><![CDATA[Update: Fix for 10.6.4 and Mail 4.3 Lately Apple has been revving the version number (and plugin compatibility UUID) of Mail.app with every version of 10.6. This breaks bundles like GrowlMail even when they are still compatible. The easy fix (although not necessarily the best if it turns out an update is required!) is to [...]]]></description>
			<content:encoded><![CDATA[<p><b>Update: Fix for <a href="http://langui.sh/2010/06/15/fixing-growlmail-in-10-6-4-mail-4-3/">10.6.4 and Mail 4.3</a></b></p>
<p>Lately Apple has been revving the version number (and plugin compatibility UUID) of Mail.app with every version of 10.6.  This breaks bundles like GrowlMail even when they are still compatible.  The easy fix (although not necessarily the best if it turns out an update is required!) is to run a few commands in Terminal to add the new UUIDs<sup class='footnote'><a href='#fn-811-1' id='fnref-811-1'>1</a></sup> to the SupportedPluginCompatibilityUUID key in the Info.plist.<sup class='footnote'><a href='#fn-811-2' id='fnref-811-2'>2</a></sup></p>
<p><b>If you have already had your plugins disabled by opening Mail.app you&#8217;ll need to look in ~/Library/Mail (or /Library/Mail if you installed globally) and move the files back to the active bundles directory.  They&#8217;ll typically be in Bundles (Disabled), so quit Mail, find them, and move them back into the proper directory.</b></p>
<p>Once you&#8217;ve gotten the files moved into the proper location use either the local installation or global installation commands below (depending on where you found your bundles).  To run them, simply copy/paste them into a Terminal window.<sup class='footnote'><a href='#fn-811-3' id='fnref-811-3'>3</a></sup></p>
<p>For GrowlMail (assuming local installation)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Mail<span style="color: #000000; font-weight: bold;">/</span>Bundles<span style="color: #000000; font-weight: bold;">/</span>GrowlMail.mailbundle<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>Info SupportedPluginCompatibilityUUIDs <span style="color: #660033;">-array-add</span> <span style="color: #ff0000;">&quot;2F0CF6F9-35BA-4812-9CB2-155C0FDB9B0F&quot;</span>
defaults <span style="color: #c20cb9; font-weight: bold;">write</span> ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Mail<span style="color: #000000; font-weight: bold;">/</span>Bundles<span style="color: #000000; font-weight: bold;">/</span>GrowlMail.mailbundle<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>Info SupportedPluginCompatibilityUUIDs <span style="color: #660033;">-array-add</span> <span style="color: #ff0000;">&quot;0CB5F2A0-A173-4809-86E3-9317261F1745&quot;</span></pre></div></div>

<p>For GrowlMail (global installation)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Mail<span style="color: #000000; font-weight: bold;">/</span>Bundles<span style="color: #000000; font-weight: bold;">/</span>GrowlMail.mailbundle<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>Info SupportedPluginCompatibilityUUIDs <span style="color: #660033;">-array-add</span> <span style="color: #ff0000;">&quot;2F0CF6F9-35BA-4812-9CB2-155C0FDB9B0F&quot;</span>
defaults <span style="color: #c20cb9; font-weight: bold;">write</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Mail<span style="color: #000000; font-weight: bold;">/</span>Bundles<span style="color: #000000; font-weight: bold;">/</span>GrowlMail.mailbundle<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>Info SupportedPluginCompatibilityUUIDs <span style="color: #660033;">-array-add</span> <span style="color: #ff0000;">&quot;0CB5F2A0-A173-4809-86E3-9317261F1745&quot;</span></pre></div></div>

<p>Update: <a href="http://harnly.net/2009/software/letterbox/letterbox-beta-5-for-snow-leopard/#more-240">Letterbox has been updated</a>, but the above instructions can be adapted for any future OS update that breaks compatibility.</p>
<p><b>Update 2: You can <a href='http://cdn.langui.sh/2009/11/GrowlMail.mailbundle.zip'>download</a> a pre-patched copy if you don&#8217;t want to follow the above instructions.  Just unzip it and drop it in your bundles directory.</b></p>
<p><b>Update 3: <a href="http://growl.info/growlmail/">GrowlMail 1.2.1</a> has been released, which fixes 10.6.2 compatibility.  This issue will likely occur again with 10.6.3 though!</b>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-811-1'>2F0CF6F9-35BA-4812-9CB2-155C0FDB9B0F for Mail.app v4.2 and 0CB5F2A0-A173-4809-86E3-9317261F1745 for the Message framework.  These were released with OS X 10.6.2. <span class='footnotereverse'><a href='#fnref-811-1'>&#8617;</a></span></li>
<li id='fn-811-2'> These UUIDs can be found in /Applications/Mail.app/Contents/Info.plist and /System/Library/Frameworks/Message.framework/Resources/Info.plist for when they inevitably change again. <span class='footnotereverse'><a href='#fnref-811-2'>&#8617;</a></span></li>
<li id='fn-811-3'>Terminal is found in /Applications/Utilities if you&#8217;ve never used it before.  You&#8217;ll see a prompt and you can paste the commands in and hit enter. <span class='footnotereverse'><a href='#fnref-811-3'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2009/11/09/fixing-growlmail-letterbox-for-mail-4-2/feed/</wfw:commentRss>
		<slash:comments>63</slash:comments>
		</item>
		<item>
		<title>Installing OS X Client in VMware Fusion</title>
		<link>http://langui.sh/2009/10/27/installing-os-x-client-in-vmware-fusion/</link>
		<comments>http://langui.sh/2009/10/27/installing-os-x-client-in-vmware-fusion/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 15:08:47 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=722</guid>
		<description><![CDATA[Mac OS X&#8217;s EULA only allows for usage of OS X Server within VMware Fusion, but with a (relatively) simple script you can modify the darwin.iso to function with OS X client as a guest.1 This script should hypothetically work with Fusion 2.0 and 3.0 on Leopard and Snow Leopard (as both guest and host). [...]]]></description>
			<content:encoded><![CDATA[<p>Mac OS X&#8217;s EULA only allows for usage of OS X Server within VMware Fusion, but with a (relatively) simple script you can modify the darwin.iso to function with OS X client as a guest.<sup class='footnote'><a href='#fn-722-1' id='fnref-722-1'>1</a></sup> This script should hypothetically work with Fusion 2.0 and 3.0 on Leopard and Snow Leopard (as both guest and host).  Save the following script to a file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #ff0000;">&quot;/Library/Application Support/VMware Fusion/isoimages&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> original
<span style="color: #c20cb9; font-weight: bold;">mv</span> darwin.iso tools-key.pub <span style="color: #000000; font-weight: bold;">*</span>.sig original
<span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-n</span> <span style="color: #660033;">-p</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/ServerVersion.plist/SystemVersion.plist/g'</span> <span style="color: #000000; font-weight: bold;">&lt;</span> original<span style="color: #000000; font-weight: bold;">/</span>darwin.iso <span style="color: #000000; font-weight: bold;">&gt;</span> darwin.iso
openssl genrsa <span style="color: #660033;">-out</span> tools-priv.pem <span style="color: #000000;">2048</span>
openssl rsa <span style="color: #660033;">-in</span> tools-priv.pem <span style="color: #660033;">-pubout</span> <span style="color: #660033;">-out</span> tools-key.pub
openssl dgst <span style="color: #660033;">-sha1</span> <span style="color: #660033;">-sign</span> tools-priv.pem <span style="color: #000000; font-weight: bold;">&lt;</span> darwin.iso <span style="color: #000000; font-weight: bold;">&gt;</span> darwin.iso.sig
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*</span>.iso ; <span style="color: #000000; font-weight: bold;">do</span> openssl dgst <span style="color: #660033;">-sha1</span> <span style="color: #660033;">-sign</span> tools-priv.pem <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #007800;">$i</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$i</span>.sig ; <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">exit</span></pre></div></div>

<p>Now open Terminal and chmod the script to executable.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>my<span style="color: #000000; font-weight: bold;">/</span>script</pre></div></div>

<p>Finally, execute the script with root privileges.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>my<span style="color: #000000; font-weight: bold;">/</span>script</pre></div></div>

<p>This will modify and re-sign the darwin.iso to allow OS X client as a guest.  Hat tip to several sources online (which I can no longer remember) that were used to help make this script many moons ago.
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-722-1'>Of course, since this is against the license agreement no one is going to use it, right? <span class='footnotereverse'><a href='#fnref-722-1'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2009/10/27/installing-os-x-client-in-vmware-fusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Various Useful OS X Shortcuts</title>
		<link>http://langui.sh/2009/10/07/various-useful-os-x-shortcuts/</link>
		<comments>http://langui.sh/2009/10/07/various-useful-os-x-shortcuts/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 23:24:34 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=595</guid>
		<description><![CDATA[A few random shortcuts I use on a daily basis&#8230;1 You can specify a unix path with the go to folder command in Finder? ⌘-⇧-G Using ⌘-1 through 9 in Safari will take you to your Bookmarks Bar bookmarks. Folders will be ignored in the numbering If you&#8217;re in a file selection dialog you can [...]]]></description>
			<content:encoded><![CDATA[<p>A few random shortcuts I use on a daily basis&#8230;<sup class='footnote'><a href='#fn-595-1' id='fnref-595-1'>1</a></sup></p>
<ul>
<li> You can specify a unix path with the go to folder command in Finder?  ⌘-⇧-G</li>
<li>Using ⌘-1 through 9 in Safari will take you to your Bookmarks Bar bookmarks.  Folders will be ignored in the numbering</li>
<li>If you&#8217;re in a file selection dialog you can use ⌘-D to go to Desktop.  Similarly ⌘-⇧-A works for Applications, ⌘-⇧-C for computer view, ⌘-⇧-H for home, and ⌘-⇧-I for idisk (automounts)</li>
<li>If you have a save/don&#8217;t save dialog up you can select don&#8217;t save with ⌘-D</li>
<li>⌘-click on a window&#8217;s title bar (in Finder, Safari, and other apps) to see a hierarchical menu</li>
<li>Drag/drop the icon in the title bar of document windows in nearly any application to perform drag/drop operations.  For example, you can drag a Word/Excel doc to Mail.app or Entourage to immediately open a new email with that doc attached.</li>
<li>Hold ⌥ and drag a file in the Finder to copy it to a new location.</li>
<li>Hold ⌥-⌘ and drag a file in the Finder to create an alias at the new location.</li>
<li>In cocoa applications you can use emacs shortcuts.</li>
<li>When browsing lists in the Finder type the first few letters of the file you&#8217;re going to and it will immediately scroll to the first occurrence of the characters alphabetically.</li>
</ul>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-595-1'>For the shortcuts ⌘ means command (also known as the apple key), ⇧ means shift, and ⌥ means option <span class='footnotereverse'><a href='#fnref-595-1'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2009/10/07/various-useful-os-x-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improving mvim for MacVim</title>
		<link>http://langui.sh/2009/10/01/improving-mvim-for-macvim/</link>
		<comments>http://langui.sh/2009/10/01/improving-mvim-for-macvim/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 14:24:25 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macvim bash]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=671</guid>
		<description><![CDATA[MacVim comes with a clever script called mvim which allows you to open files in MacVim via the command line (much like mate for TextMate). This is a wonderful tool, but does possess some idiosyncrasies. It creates a new window (rather than a new tab) when you invoke it and it also won&#8217;t take stdin [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/macvim/">MacVim</a> comes with a clever script called <i>mvim</i> which allows you to open files in MacVim via the command line (much like <i>mate</i> for TextMate).  This is a wonderful tool, but does possess some idiosyncrasies.  It creates a new window (rather than a new tab) when you invoke it and it also won&#8217;t take stdin as input unless you pass a dash<sup class='footnote'><a href='#fn-671-1' id='fnref-671-1'>1</a></sup>.</p>
<p>To fix this I modified the script to check for an existing macvim process, and if it exists attach tabs to it.<sup class='footnote'><a href='#fn-671-2' id='fnref-671-2'>2</a></sup>  Additionally, it checks for args and if none are present (or just -) the script invokes stdin.  I am not much of a bash hacker though, so there are a few caveats&#8230;</p>
<ul>
<li>&#8211;remote-tab-silent doesn&#8217;t seem to work with listening on stdin, so the script always pops it out into a new window.</li>
<li>You (apparently) can&#8217;t pass extra parameters when using &#8211;remote-tab-silent, so tricks like mvim /etc/hosts +5 to have it open with the cursor on line 5 will not work.</li>
</ul>
<p>These are both irritating, but I feel the advantages outweigh the disadvantages.  Hopefully someone can contribute fixes to these problems!</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This shell script passes all its arguments to the binary inside the</span>
<span style="color: #666666; font-style: italic;"># MacVim.app application bundle.  If you make links to this script as view,</span>
<span style="color: #666666; font-style: italic;"># gvim, etc., then it will peek at the name used to call it and set options</span>
<span style="color: #666666; font-style: italic;"># appropriately.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Based on a script by Wout Mertens and suggestions from Laurent Bihanic.  This</span>
<span style="color: #666666; font-style: italic;"># version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico</span>
<span style="color: #666666; font-style: italic;"># Weber and Bjorn Winckler, Aug 13 2007.  Some mediocre hacking by Paul Kehrer Sep 30 2009).</span>
<span style="color: #666666; font-style: italic;"># First, check &quot;All the Usual Suspects&quot; for the location of the Vim.app bundle.</span>
<span style="color: #666666; font-style: italic;"># You can short-circuit this by setting the VIM_APP_DIR environment variable</span>
<span style="color: #666666; font-style: italic;"># or by un-commenting and editing the following line:</span>
<span style="color: #666666; font-style: italic;"># VIM_APP_DIR=/Applications</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VIM_APP_DIR</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #007800;">myDir</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`dirname &quot;$0&quot;`</span>&quot;</span>
	<span style="color: #007800;">myAppDir</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$myDir</span>/../Applications&quot;</span>
	<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> ~<span style="color: #000000; font-weight: bold;">/</span>Applications ~<span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #007800;">$myDir</span> <span style="color: #007800;">$myDir</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #007800;">$myAppDir</span> <span style="color: #007800;">$myAppDir</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>Applications <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>Utilities <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>Utilities<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">vim</span>; <span style="color: #000000; font-weight: bold;">do</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-x</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span>/MacVim.app&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #007800;">VIM_APP_DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span>&quot;</span>
			<span style="color: #7a0874; font-weight: bold;">break</span>
		<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VIM_APP_DIR</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Sorry, cannot find MacVim.app.  Try setting the VIM_APP_DIR environment variable to the directory containing MacVim.app.&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #007800;">binary</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$VIM_APP_DIR</span>/MacVim.app/Contents/MacOS/Vim&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Next, peek at the name used to invoke this script, and set options</span>
<span style="color: #666666; font-style: italic;"># accordingly.</span>
&nbsp;
<span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`basename &quot;$0&quot;`</span>&quot;</span>
<span style="color: #007800;">gui</span>=
<span style="color: #007800;">opts</span>=
&nbsp;
<span style="color: #666666; font-style: italic;"># GUI mode, implies forking</span>
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$name</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span> m<span style="color: #000000; font-weight: bold;">*|</span>g<span style="color: #000000; font-weight: bold;">*|</span>rg<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">gui</span>=<span style="color: #c20cb9; font-weight: bold;">true</span> <span style="color: #000000; font-weight: bold;">;;</span> <span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Restricted mode</span>
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$name</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span> r<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">opts</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$opts</span> -Z&quot;</span><span style="color: #000000; font-weight: bold;">;;</span> <span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># vimdiff and view</span>
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$name</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
	<span style="color: #000000; font-weight: bold;">*</span>vimdiff<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #007800;">opts</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$opts</span> -dO&quot;</span>
		<span style="color: #000000; font-weight: bold;">;;</span>
	<span style="color: #000000; font-weight: bold;">*</span>view<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #007800;">opts</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$opts</span> -R&quot;</span>
		<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #007800;">tabs</span>=<span style="color: #c20cb9; font-weight: bold;">true</span>
<span style="color: #007800;">stdinoption</span>=<span style="color: #c20cb9; font-weight: bold;">false</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#let's see if we need to read from stdin</span>
<span style="color: #666666; font-style: italic;">#script currently assumes NO PARAMETERS</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #000000;">1</span> == \- <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #007800;">stdinoption</span>=<span style="color: #c20cb9; font-weight: bold;">true</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Last step:  fire up vim.</span>
<span style="color: #666666; font-style: italic;"># The program should fork by default when started in GUI mode, but it does</span>
<span style="color: #666666; font-style: italic;"># not; we work around this when this script is invoked as &quot;gvim&quot; or &quot;rgview&quot;</span>
<span style="color: #666666; font-style: italic;"># etc., but not when it is invoked as &quot;vim -g&quot;.</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$gui</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #666666; font-style: italic;"># Note: this isn't perfect, because any error output goes to the</span>
	<span style="color: #666666; font-style: italic;"># terminal instead of the console log.</span>
	<span style="color: #666666; font-style: italic;"># But if you use open instead, you will need to fully qualify the</span>
	<span style="color: #666666; font-style: italic;"># path names for any filenames you specify, which is hard.</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #007800;">$stdinoption</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$binary</span>&quot;</span> <span style="color: #660033;">-g</span> - 
	<span style="color: #000000; font-weight: bold;">else</span> 
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #007800;">$tabs</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ps</span> x<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'MacOS/MacVim'</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #c20cb9; font-weight: bold;">grep</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</span> = <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #007800;">$binary</span> --serverlist<span style="color: #000000; font-weight: bold;">`</span> = <span style="color: #ff0000;">&quot;VIM&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #666666; font-style: italic;">#when using remote tabs you can't pass things like +5.</span>
			<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$binary</span>&quot;</span> <span style="color: #660033;">-g</span> <span style="color: #007800;">$opts</span> <span style="color: #660033;">--remote-tab-silent</span> <span style="color: #800000;">${1:+&quot;$@&quot;}</span>
		<span style="color: #000000; font-weight: bold;">else</span>
			<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$binary</span>&quot;</span> <span style="color: #660033;">-g</span> <span style="color: #007800;">$opts</span> <span style="color: #800000;">${1:+&quot;$@&quot;}</span> 
		<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">else</span>
	<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$binary</span>&quot;</span> <span style="color: #007800;">$opts</span> <span style="color: #800000;">${1:+&quot;$@&quot;}</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-671-1'>This is the standard vim way, but feels irritatingly inelegant to me. <span class='footnotereverse'><a href='#fnref-671-1'>&#8617;</a></span></li>
<li id='fn-671-2'>The script does a ps x to check for the existence of a macvim process.  This is done before the serverlist check because the script will output ugly errors to stdout if there is no macvim process. <span class='footnotereverse'><a href='#fnref-671-2'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2009/10/01/improving-mvim-for-macvim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NTFS-3G 64-bit PrefPane For Snow Leopard</title>
		<link>http://langui.sh/2009/09/29/ntfs-3g-64-bit-prefpane-for-snow-leopard/</link>
		<comments>http://langui.sh/2009/09/29/ntfs-3g-64-bit-prefpane-for-snow-leopard/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 16:57:51 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[prefpane]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=662</guid>
		<description><![CDATA[Update: A version of NTFS-3G with native 64-bit PrefPane support has been released. The instructions below have been left for archival purposes, but are no longer required. I use NTFS-3G + MacFUSE to write to NTFS disks on occasion, but I hate restarting System Preferences just to run a 32-bit PrefPane when I want to [...]]]></description>
			<content:encoded><![CDATA[<p>Update: A version of NTFS-3G with native 64-bit PrefPane support has been <a href="http://macntfs-3g.blogspot.com/">released</a>.  The instructions below have been left for archival purposes, but are no longer required.</p>
<p>I use NTFS-3G + MacFUSE to write to NTFS disks on occasion, but I hate restarting System Preferences just to run a 32-bit PrefPane when I want to view/change some settings.  Behold the power of open source!</p>
<p>To compile a 64-bit System Preferences compatible version of this item simply </p>
<ol>
<li>Grab the <a href="http://downloads.sourceforge.net/catacombae/ntfs-3g_prefpane-0.9.8-src.tar.bz2?use_mirror=">source</a> for the <a href="http://macntfs-3g.blogspot.com/">NTFS-3G</a> PrefPane</li>
<li>Right click and get info on the build target to add x86_64, turn on Objective-C garbage collection to &#8220;supported&#8221;<sup class='footnote'><a href='#fn-662-1' id='fnref-662-1'>1</a></sup></li>
<li>Build the target.</li>
</ol>
<p>&#8230;and you&#8217;re all set.  You can <a href='http://cdn.langui.sh/2009/09/NTFS-3G.prefPane.zip'>download</a> my copy, but I don&#8217;t recommend using it in 10.5 or 10.4.  Of course, you don&#8217;t need a 64-bit PrefPane prior to 10.6 so why would you download it anyway?
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-662-1'>If you set it to supported it should work in OS X 10.5 still <span class='footnotereverse'><a href='#fnref-662-1'>&#8617;</a></span></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2009/09/29/ntfs-3g-64-bit-prefpane-for-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Changing OS X Short Name</title>
		<link>http://langui.sh/2009/08/02/changing-os-x-short-name/</link>
		<comments>http://langui.sh/2009/08/02/changing-os-x-short-name/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 16:05:02 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=637</guid>
		<description><![CDATA[When my work laptop was originally set up the short name was set to &#8220;paul kehrer&#8221;. This space tends to cause issues with poorly written applications, especially on the command line, so I set out to change it. Prior to Leopard this was a difficult task best accomplished with ChangeShortName, but with Leopard you can [...]]]></description>
			<content:encoded><![CDATA[<p>When my work laptop was originally set up the short name was set to &#8220;paul kehrer&#8221;.  This space tends to cause issues with poorly written applications, especially on the command line, so I set out to change it.  Prior to Leopard this was a difficult task best accomplished with <a href="http://www.danfrakes.com/ChangeShortName.html">ChangeShortName</a>, but with Leopard you can now do it without any third party utilities.</p>
<p><a href="http://cdn.langui.sh/2009/08/advancedoptions1.png"><img src="http://cdn.langui.sh/2009/08/advancedoptions1.png" alt="advancedoptions" title="advancedoptions" width="246" height="75" class="alignright size-full wp-image-640" /></a>First you&#8217;ll need to create a secondary admin account and log into that.  While you can directly change the short name of an account you are logged into, I wouldn&#8217;t recommend it.  Next, open system preferences, go to accounts, and right click the user you want to change.  You&#8217;ll see a single menu item called &#8220;advanced options&#8230;&#8221;.</p>
<p><a href="http://cdn.langui.sh/2009/08/useroptions.png"><img src="http://cdn.langui.sh/2009/08/useroptions-150x150.png" alt="useroptions" title="useroptions" width="150" height="150" class="alignright size-thumbnail wp-image-645" /></a>Choosing that will bring up a sheet that lets you change your user ID, group ID, short name, logins hell, home directory path, UUID, and add/remove aliases (other login names) for your account.  While these are all very powerful tools we&#8217;re only going to use short name and home directory this time.  In general it is safest to keep your short name and home directory path synchronized to avoid any issues that might arise from poorly written apps, but it is not required to change both.  If you do change the home dir, then be aware that you&#8217;ll also need to run this command from the terminal to complete your account switch.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>oldshortname <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>newshortname</pre></div></div>

<p>Once you&#8217;ve done this you can log back in to the other account and you&#8217;re all set.  Be aware that some apps do use hard coded paths for preferences, so you&#8217;ll probably have a few small issues to correct as you get up to speed.</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2009/08/02/changing-os-x-short-name/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
