<?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>Jeff Kelley’s Blog &#187; open-source</title>
	<atom:link href="http://blog.slaunchaman.com/tag/open-source/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.slaunchaman.com</link>
	<description>Mac tips, iPhone applications, and the like</description>
	<lastBuildDate>Thu, 19 Aug 2010 21:14:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Apple Doesn’t Like “Die, You Gravy-Sucking Pig-Dog!”</title>
		<link>http://blog.slaunchaman.com/2010/08/19/apple-doesn%e2%80%99t-like-%e2%80%9cdie-you-gravy-sucking-pig-dog%e2%80%9d/</link>
		<comments>http://blog.slaunchaman.com/2010/08/19/apple-doesn%e2%80%99t-like-%e2%80%9cdie-you-gravy-sucking-pig-dog%e2%80%9d/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 21:14:12 +0000</pubDate>
		<dc:creator>Jeff Kelley</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[BSD]]></category>
		<category><![CDATA[Easter eggs]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[UNIX beard]]></category>

		<guid isPermaLink="false">http://blog.slaunchaman.com/?p=328</guid>
		<description><![CDATA[There’s a relatively well-known Easter]]></description>
			<content:encoded><![CDATA[<p>There’s a <a href="http://www.codinghorror.com/blog/2009/01/die-you-gravy-sucking-pig-dog.html">relatively well-known</a> Easter egg in BSD’s <code>shutdown.c</code>: a function named <code>die_you_gravy_sucking_pig_dog</code> (side note: I’ve got three-to-one odds that say whoever wrote that has a huge UNIX beard). It turns out that Apple doesn’t care to have such uncouth function names floating around, so <a href="http://opensource.apple.com/source/system_cmds/system_cmds-498.2/shutdown.tproj/shutdown.c">they re-defined it</a>:</p>
<blockquote><p><code>#ifdef __APPLE__<br />
void log_and_exec_reboot_or_halt(void);<br />
#else<br />
void die_you_gravy_sucking_pig_dog(void);<br />
#endif</code></p></blockquote>
<p>Sure, it does the same thing, but I don’t think <code>log_and_exec_reboot_or_halt</code> has the same panache.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.slaunchaman.com/2010/08/19/apple-doesn%e2%80%99t-like-%e2%80%9cdie-you-gravy-sucking-pig-dog%e2%80%9d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New iPhone Project: uWarranty</title>
		<link>http://blog.slaunchaman.com/2010/03/09/new-iphone-project-uwarranty/</link>
		<comments>http://blog.slaunchaman.com/2010/03/09/new-iphone-project-uwarranty/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 17:56:59 +0000</pubDate>
		<dc:creator>Jeff Kelley</dc:creator>
				<category><![CDATA[My Software]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa Touch]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[uWarranty]]></category>

		<guid isPermaLink="false">http://blog.slaunchaman.com/?p=244</guid>
		<description><![CDATA[So, I created a new]]></description>
			<content:encoded><![CDATA[<p>So, I created a new iPhone application called uWarranty. It used an unpublished Apple API for warranty status (from selfsolve.apple.com), and so I got this after submitting it:</p>
<blockquote><p>Thank you for submitting your application to the App Store. Unfortunately, your application, uWarranty, cannot be added to the App Store because it violates section 3.3.7 of the iPhone Developer Program License Agreement:</p>
<p>&#8220;Applications may not perform any functions or link to any content or use any robot, spider, site search or other retrieval application or device to scrape, retrieve or index services provided by Apple or its licensors, or to collect, disseminate or use information about users for any unauthorized purpose.&#8221;</p></blockquote>
<p>OK, I get it. That&rsquo;s fine and is Apple&rsquo;s prerogative. But now I have this program and all the development time that went into it. So what do I do? I guess the answer is to open-source it, just like <a title="AppSales Mobile" href="http://github.com/omz/AppSales-Mobile" target="_blank">AppSales Mobile</a>. Watch this space for more details as I clean up the code and throw it up on a public repository somewhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.slaunchaman.com/2010/03/09/new-iphone-project-uwarranty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically get the latest Chromium snapshot with launchd</title>
		<link>http://blog.slaunchaman.com/2009/05/19/automatically-get-the-latest-chromium-snapshot-with-launchd/</link>
		<comments>http://blog.slaunchaman.com/2009/05/19/automatically-get-the-latest-chromium-snapshot-with-launchd/#comments</comments>
		<pubDate>Wed, 20 May 2009 04:24:08 +0000</pubDate>
		<dc:creator>Jeff Kelley</dc:creator>
				<category><![CDATA[Miscellania]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[Chromium]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[launchd]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://blog.slaunchaman.com/?p=183</guid>
		<description><![CDATA[I’ve been checking out the]]></description>
			<content:encoded><![CDATA[<p>I’ve been checking out the <a href="http://build.chromium.org/buildbot/snapshots/sub-rel-mac">snapshots</a> of <a href="http://www.chromium.org">Chromium</a> recently, and they’re coming quicker than you can say “multithreaded web browser.” To facilitate always having the latest version, I wrote a quick LaunchAgent that takes care of it on Mac OS X. First, I have a script named <strong>~/bin/chromiupdate</strong>:<br />
<code><br />
<blockquote>
<pre>#!/bin/bash

# Downloads the latest version of Chromium.

remove_working_dir()
{
    rm -rf "${WORKING_DIR}"
    exit 0
}

USER_DIR=$(dscl . -read /Users/$(whoami) NFSHomeDirectory | awk '{ print $2 }')
USER_APP_DIR="${USER_DIR}/Applications"
CHROMIUM_DIR="${USER_APP_DIR}/Chromium.app"
LATEST_URL="http://build.chromium.org/buildbot/snapshots/sub-rel-mac/LATEST"
TMP_DIR="/private/tmp"
WORKING_DIR="${TMP_DIR}/.chromium_launchd"
URL_BEGIN="http://build.chromium.org/buildbot/snapshots/sub-rel-mac"

if [ ! -d "${CHROMIUM_DIR}" ]; then
    mkdir -p "${CHROMIUM_DIR}"
fi

INSTALLED_VERSION="$(defaults read "${CHROMIUM_DIR}/Contents/Info" SVNRevision)"
VERSION=$(curl "${LATEST_URL}")

if [ "${VERSION}" != "${INSTALLED_VERSION}" ]; then
    logger Installed Chromium version \(${INSTALLED_VERSION}\) does not equal \
            latest version \(${VERSION}\), updating now...
    mkdir "${WORKING_DIR}" || exit 1
    trap remove_working_dir 1 2 3 6 15
    cd "${WORKING_DIR}" || exit 1
    curl -O "${URL_BEGIN}/${VERSION}/chrome-mac.zip"
    unzip chrome-mac.zip
    rsync -HavP --exclude="Contents/MacOS/chrome_debug.log" \
          "${WORKING_DIR}/chrome-mac/Chromium.app/" "${CHROMIUM_DIR}/"

    if [ "$(ps -aef | grep -i chromium | grep -v grep)" != "" ]; then
        open "${USER_DIR}/Library/Scripts/Chromium Update Dialog.app"
    fi

    logger "Chromium update complete. Version ${VERSION} installed."

    remove_working_dir
else
    logger Installed Chromium version \(${INSTALLED_VERSION}\) is up-to-date. \
           No action needed.
fi

exit 0</pre>
</blockquote>
<p></code><br />
Next, I have a property list named <strong>~/Library/LaunchAgents/com.slaunchaman.chromium.plist</strong>:<br />
<code><br />
<blockquote>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd &gt;
&lt;plist version="1.0"&gt;
    &lt;dict&gt;
        &lt;key&gt;Label&lt;/key&gt;
        &lt;string&gt;com.slaunchaman.chromium&lt;/string&gt;
        &lt;key&gt;Program&lt;/key&gt;
        &lt;string&gt;/Users/slauncha/bin/chromiupdate&lt;/string&gt;
        &lt;key&gt;KeepAlive&lt;/key&gt;
        &lt;false/&gt;
        &lt;key&gt;StartInterval&lt;/key&gt;
        &lt;integer&gt;3600&lt;/integer&gt;
        &lt;key&gt;RunAtLoad&lt;/key&gt;
        &lt;true/&gt;
        &lt;key&gt;StandardOutPath&lt;/key&gt;
        &lt;string&gt;/dev/null&lt;/string&gt;
        &lt;key&gt;StandardErrorPath&lt;/key&gt;
        &lt;string&gt;/dev/null&lt;/string&gt;
    &lt;/dict&gt;
&lt;/plist&gt;</pre>
</blockquote>
<p></code></p>
<p>Finally, I have an AppleScript at <strong>~/Library/Scripts/Chromium Update Dialog.app</strong>:<br />
<code><br />
<blockquote>
<pre>display dialog "Chromium was just updated. You should restart it."</pre>
</blockquote>
<p></code></p>
<p>The LaunchAgent runs once an hour, checking to see if the installed version of Chromium is older than the latest snapshot. If so, it downloads it and uses <strong>rsync</strong> to copy the changes. The script places Chromium in <strong>~/Applications</strong>, but it shouldn’t be hard to modify to put it into /Applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.slaunchaman.com/2009/05/19/automatically-get-the-latest-chromium-snapshot-with-launchd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prevent Mac OS X Leopard from Prompting You to Start Synergyd Every Time You Use SynergyKM</title>
		<link>http://blog.slaunchaman.com/2008/07/30/prevent-mac-os-x-leopard-from-prompting-you-to-start-synergyd-every-time-you-use-synergykm/</link>
		<comments>http://blog.slaunchaman.com/2008/07/30/prevent-mac-os-x-leopard-from-prompting-you-to-start-synergyd-every-time-you-use-synergykm/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 15:25:58 +0000</pubDate>
		<dc:creator>Jeff Kelley</dc:creator>
				<category><![CDATA[Mac Tips]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[Synergy]]></category>

		<guid isPermaLink="false">http://blog.slaunchaman.com/?p=74</guid>
		<description><![CDATA[So here’s an annoyance.  Having]]></description>
			<content:encoded><![CDATA[<p>So here’s an annoyance.  Having just installed <a href="http://sourceforge.net/projects/synergykm">SynergyKM</a>, a great front-end for the awesome command-line utility <a href="http://synergy2.sourceforge.net/">Synergy</a>, launching it would result in the following prompt:</p>
<div id="attachment_75" class="wp-caption aligncenter" style="width: 510px"><a href="http://blog.slaunchaman.com/wp-content/uploads/2008/07/picture-3.png"><img class="size-full wp-image-75" title="Synergyd Prompt" src="http://blog.slaunchaman.com/wp-content/uploads/2008/07/picture-3.png" alt="The promt you get when launching SynergyKM" width="500" height="242" /></a><p class="wp-caption-text">The promt you get when launching SynergyKM</p></div>
<p>To fix this, you need to remove the extended attribute <em>com.apple.quarantine</em> that’s on the file.  Fire up Terminal and enter the following commands:</p>
<blockquote><p><tt>sudo xattr -d com.apple.quarantine /Library/PreferencePanes/SynergyKM.prefPane/Contents/Resources/Synergyd.app<br />
sudo xattr -d com.apple.quarantine /Library/PreferencePanes/SynergyKM.prefPane/Contents/Resources/Synergyd.app/Contents/MacOS/Synergyd</tt></p></blockquote>
<p>That will remove the flags and prevent the prompt.</p>
<p>Normally, you’d only see this prompt once, but since installing it for all users changes permissions such that your user account can’t remove the attribute, it isn’t removed.</p>
<p><strong>Note:</strong> This is assuming that you’ve installed it for all users.  If you’ve installed it for one user, it’ll be in ~/Library, not /Library.</p>
<p><strong>Update:</strong> I’ve submitted a patch to SynergyKM’s SourceForge page, so if they accept it this will no longer be an issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.slaunchaman.com/2008/07/30/prevent-mac-os-x-leopard-from-prompting-you-to-start-synergyd-every-time-you-use-synergykm/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
