<?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>James Badger&#039;s Personal Site &#187; Local Talk</title>
	<atom:link href="http://jamesbadger.ca/category/local-talk/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamesbadger.ca</link>
	<description></description>
	<lastBuildDate>Wed, 21 Mar 2012 00:45:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Play Sound (Universal)</title>
		<link>http://jamesbadger.ca/2011/04/04/play-sound-universal/</link>
		<comments>http://jamesbadger.ca/2011/04/04/play-sound-universal/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 01:40:37 +0000</pubDate>
		<dc:creator>James Badger</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Local Talk]]></category>

		<guid isPermaLink="false">http://jamesbadger.ca/?p=106</guid>
		<description><![CDATA[I received some requests to update the Play Sound Automator action to work with newer Macs, so I went and posted the source to Github. Upon restoring the source code from a backup, it was quite a surprise finding out &#8230; <a href="http://jamesbadger.ca/2011/04/04/play-sound-universal/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I received some requests to update the <a href="http://jamesbadger.ca/2005/11/16/20/">Play Sound</a> Automator action to work with newer Macs, so I went and posted the <a href="https://github.com/openfirmware/Play-Sound">source to Github.</a> Upon restoring the source code from a backup, it was quite a surprise finding out that it was already a git repo… five years ago!</p>
<p>I also rebuilt a binary version of the action, which is incredibly simple to install: just double-click. It is also compatible with both PPC and Intel Macs, I had success running it with 10.4 on a G4 Mac Mini. You can <a href="https://github.com/downloads/openfirmware/Play-Sound/PlaySound_Universal.zip">download from Github</a> or <a href="http://jamesbadger.ca/wp-downloads/PlaySound_Universal.zip">download from my site</a>.</p>
<p>Additionally, it is now open source so if you see any changes (the code has been changed in over five years), fork it on Github and let me know!</p>
<p>Special Thanks:<br />
<a href="http://stackoverflow.com/questions/5303507/create-universal-automator-action/5343462#5343462">StackOverflow — Create Universal Automator Action</a><br />
<a href="http://googlefodder.tumblr.com/post/287723746/64-bit-automator-and-snow-leopard">Google Fodder — 64-bit Automator and Snow Leopard</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jamesbadger.ca/2011/04/04/play-sound-universal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lighttpd + Mongrel + Rails + Windows</title>
		<link>http://jamesbadger.ca/2009/04/25/lighttpd-mongrel-rails-windows/</link>
		<comments>http://jamesbadger.ca/2009/04/25/lighttpd-mongrel-rails-windows/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 04:31:26 +0000</pubDate>
		<dc:creator>James Badger</dc:creator>
				<category><![CDATA[Local Talk]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[LightTPD]]></category>
		<category><![CDATA[Mongrel]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://jamesbadger.ca/?p=77</guid>
		<description><![CDATA[I recently worked on a project that required me to host a rails application on Windows XP Home, something I had no experience with but took on as our options were limited. We wanted a load-balanced server running a Rails &#8230; <a href="http://jamesbadger.ca/2009/04/25/lighttpd-mongrel-rails-windows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently worked on a project that required me to host a rails application on Windows XP Home, something I had no experience with but took on as our options were limited. We wanted a load-balanced server running a Rails app with a MySQL database. An XAMPP install was also being used by another group on the server, through which we had MySQL access.</p>
<p>I learned quite a bit trying to get it working, and I hope I can help someone else with how I did it. I started this last fall, so some of the software may have been updated. Also, I would like to thank Joseph Jaramillo for his post on <a href="http://www.mightyinteractive.com/ruby-on-rails/deploying-to-iis-on-windows/">Deploying to IIS with lighttpd and Mongrel</a> which was a huge help setting this up.</p>
<p><span id="more-77"></span></p>
<h2 class="heading">1. Install Ruby</h2>
<p>For Ruby, I used the 1.8.6 <a href="http://www.ruby-lang.org/en/downloads/">one-click installer</a>. Download, and install.</p>
<h2 class="heading">2. Install Ruby Gems</h2>
<p>Hop on over to RubyForge and grab the <a href="http://rubyforge.org/frs/?group_id=126">latest zip file</a> (rubygems-1.3.2.zip as of this article). Download, and install.</p>
<h2 class="heading">3. Install Rails and Mongrel</h2>
<p>Open a command prompt and run <strong>gem install rails</strong> to get rails installed. Next, run <strong>gem install mongrel mongrel_service</strong> which will install the <a href="http://mongrel.rubyforge.org/">Mongrel</a> server.</p>
<h2 class="heading">4. Setup a Rails Application</h2>
<p>I will assume you have setup a Rails application before, and know how to create one from scratch or that you have one ready to drop in to be served. If you are not that experienced with Rails yet, I would recommend starting with Mongrel only for development.</p>
<p>Try out your Rails install by opening a command prompt to your Rails directory and running <strong>script\server</strong> (note the backslash), and then see if rails loads at <a href="http://localhost:3000/">http://localhost:3000/</a>. You may get a Windows Security Alert that you need to unblock to allow outgoing connections. At this point, you have enough to run a Rails server for development, but the aim of this article is to be more robust.</p>
<h2 class="heading">5. Install lighttpd</h2>
<p>Lighttpd is a great lightweight server that will be an excellent load-balancing proxy for this setup. We could have hooked into the Apache install from XAMPP, but I did not want to cause any problems for the group running that server.<br />
To install lighttpd, download the most recent lighttpd installer from the <a href="http://code.google.com/p/wlmp-project/">WLMP project</a> (I used LightTPD-1.4.22-1-Win32-SSL.exe). I had major problems with a Cygwin1.dll from an openSSH install conflicting with the ones for lighttpd, and had to remove the openSSH Cygwin1.dll before lighttpd would work properly; you can check for this error by running lighttpd from a command prompt and seeing if you get an error.</p>
<h2 class="heading">6. Install Windows Server 2003 Resource Kit</h2>
<p>To get lighttpd running as the kind of service we need, download and install the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&#038;displaylang=en">Windows Server 2003 Resource Kit</a>.</p>
<h2 class="heading">7. Install Mongrel Rails Service</h2>
<p>We are going to have two Mongrel servers serving our Rails application, although you can run more (See <a href="http://mongrel.rubyforge.org/wiki/Tuning">How Many Mongrel Instances Should I Run?</a>). To do this, open a command prompt and goto your Rails app directory. For each Mongrel server you want to run, enter the following command:<br />
<strong>mongrel_rails service::install -N rails_app_4001 -p 4001</strong><br />
Increase the number by one for each service (4002, 4003, etc) as you run the command. This command will install Windows services that will run our Mongrel servers in the background. To start these servers, run the following command for each server, incrementing the number for each server (4001, 4002, etc.):<br />
<strong>net start rails_app_4001</strong><br />
To make it easy to start and stop these servers, create a mserver.bat file in your Rails directory with the following contents:</p>
<blockquote><p>
@echo off<br />
net %1 rails_app_4001<br />
net %1 rails_app_4002
</p></blockquote>
<p>Add additional lines for each extra Mongrel server, again incrementing the number. This script will allow you to start/stop all the servers by opening a command prompt, going to the Rails directory, and typing <strong>mserver.bat start</strong> or <strong>mserver.bat stop</strong> , which will come in handy when restarting your Rails app. To test if these servers are running, open a web browser and navigate to ports <a href="http://localhost:4001/">4001</a>, <a href="http://localhost:4002/">4002</a>, etc on your server and see if your Rails app shows up.
</p>
<h2 class="heading">8. Setup lighttpd Proxy</h2>
<p>Download and install <a href="http://www.mightyinteractive.com/ruby-on-rails/deploying-to-iis-on-windows/lighttpd.conf">Joseph Jaramillo&#8217;s lighttpd conf file</a> to your Rails directory, and put it in your config directory.<br />
<br />Edit the file with an app that supports UNIX-style line endings (not notepad), changing the following values:</p>
<p><strong>var.basedir = &#8220;C:/Rails/myrailsapp&#8221;</strong> (point to your Rails app directory, use forward slashes)<br />
<strong>server.bind = &#8220;&#8221;</strong> (do not bind to a specific address)<br />
<strong>server.port = 3000</strong> (the port you want your users to use. 80 is a good default, or if already used as in my case, 3000)<br />
and under <strong>proxy.server</strong>, add extra entries for any additional Mongrel servers you are running.</p>
<p>Next, setup lighttpd to run as a Windows service. <a href="http://www.mightyinteractive.com/ruby-on-rails/deploying-to-iis-on-windows/index3.shtml">Follow Joseph&#8217;s instructions on step 3,</a> of course changing the AppParameters to use the path to your lighttpd config file in your rails directory. Test your setup by pointing your browser at your server&#8217;s main address (or other port if you chose one other than 80), and you should see your Rails application!</p>
<p></p>
<p>If you have any comments, suggestions, or problems let me know in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesbadger.ca/2009/04/25/lighttpd-mongrel-rails-windows/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Quicksilver + iTunes + Growl</title>
		<link>http://jamesbadger.ca/2008/11/28/quicksilver-itunes-growl/</link>
		<comments>http://jamesbadger.ca/2008/11/28/quicksilver-itunes-growl/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 05:25:23 +0000</pubDate>
		<dc:creator>James Badger</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Local Talk]]></category>

		<guid isPermaLink="false">http://jamesbadger.ca/?p=67</guid>
		<description><![CDATA[One of the most handy tools for Mac has to be Quicksilver. It does 90% of my application launching, and has a plethora of plugins and other features too, like triggers. Triggers work like global hotkeys. For example, I can &#8230; <a href="http://jamesbadger.ca/2008/11/28/quicksilver-itunes-growl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the most handy tools for Mac has to be <a href="http://docs.blacktree.com/quicksilver/what_is_quicksilver">Quicksilver</a>. It does 90% of my application launching, and has a plethora of plugins and other features too, like triggers. Triggers work like global hotkeys. For example, I can press control-F8 in (almost) any application and have iTunes skip to the next song.</p>
<p>What I like to do is be able to rate my iTunes music without having to switch to iTunes or fumble around with the dock contextual menu. With a Quicksilver trigger this is easy, just install the iTunes module and a handful of iTunes-specific triggers are added. However, I prefer to have visual notification that the trigger worked, so I made a few Applescripts to automatically set the rating and tell <a href="http://growl.info/">Growl</a> to display a notification that the change was made.</p>
<p>Script below:</p>
<p><span id="more-67"></span></p>
<pre class="brush: applescript;">
-- check for apps needed
tell application "System Events"
	set iTunesRunning to ¬
		(count of (every process whose name is "iTunes")) > 0
	set growlRunning to ¬
		(count of (every process whose name is "GrowlHelperApp")) > 0
end tell

if iTunesRunning is true and growlRunning is true then
	tell application "iTunes"
		set thistrack to current track
		set therating to 20
		set rating of thistrack to (therating)
		set songdesc to (name of thistrack) &#038; return &#038; (artist of thistrack) &#038; return &#038; (album of thistrack)
		set trackArt to (data of artwork 1 of thistrack)
	end tell
	tell application "GrowlHelperApp"
		set the allNotificationsList to {"Star Rating"}
		set the enabledNotificationsList to {"Star Rating"}
		register as application "Rating Scripts" all notifications allNotificationsList default notifications enabledNotificationsList
		notify with name "Star Rating" title "★☆☆☆☆" description songdesc application name "Rating Scripts" pictImage trackArt
	end tell
end if
</pre>
<p>I saved five version of the script, for ratings 1 to 5, changing the values for each one. &#8220;set therating to 20&#8243; is one star, 40 is two stars, etc. I also changed the ★s for each script. Then in Quicksilver, I added new triggers that activated these scripts, and now control-F1 through F5 rate the current song, and display a Growl notification with track art and information.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesbadger.ca/2008/11/28/quicksilver-itunes-growl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

