<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Lincoln Stoll</title>
 <link href="http://lstoll.net/atom.xml" rel="self"/>
 <link href="http://lstoll.net/"/>
 <updated>2012-02-22T17:51:15+00:00</updated>
 <id>http://lstoll.net/</id>
 <author>
   <name>Lincoln Stoll</name>
   <email>lstoll@lstoll.net</email>
 </author>

 
 <entry>
   <title>Fog and the Vcloud API</title>
   <link href="http://lstoll.net/2011/07/11/fog-and-vcloud.html"/>
   <updated>2011-07-11T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2011/07/11/fog-and-vcloud</id>
   <content type="html">&lt;h1 id='fog_and_the_vcloud_api'&gt;Fog and the Vcloud API&lt;/h1&gt;
&lt;p class='meta'&gt;19/05/2011&lt;/p&gt;
&lt;p&gt;This post is located at &lt;a href='http://techblog.realestate.com.au/2011/07/controlling-vcloud-with-ruby-via-fog/'&gt;http://techblog.realestate.com.au/2011/07/controlling-vcloud-with-ruby-via-fog/&lt;/a&gt; , redirecting&amp;#8230;&lt;/p&gt;
&lt;script type='text/javascript'&gt;
window.location = &quot;http://techblog.realestate.com.au/2011/07/controlling-vcloud-with-ruby-via-fog/&quot;;
&lt;/script&gt;</content>
 </entry>
 
 <entry>
   <title>Ninefold API Action with Fog</title>
   <link href="http://lstoll.net/2011/05/19/fog-and-ninefold.html"/>
   <updated>2011-05-19T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2011/05/19/fog-and-ninefold</id>
   <content type="html">&lt;h1 id='ninefold_api_action_with_fog'&gt;Ninefold API Action with Fog&lt;/h1&gt;
&lt;p class='meta'&gt;19/05/2011&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been working on adding support for &lt;a href='http://ninefold.com'&gt;Ninefold&lt;/a&gt; to &lt;a href='http://fog.io'&gt;Fog&lt;/a&gt;, and the code is now in a somewhat beta state. It is now possible to create a machine via the library, and set up networking to access it - then tear it all down.&lt;/p&gt;

&lt;h2 id='i_want_to_have_a_look'&gt;I want to have a look!&lt;/h2&gt;

&lt;p&gt;I&amp;#8217;ve created a sample Rake script to demonstrate this, it can be found at &lt;a href='https://gist.github.com/ee5b65a8ed778ce61963'&gt;https://gist.github.com/ee5b65a8ed778ce61963&lt;/a&gt;. Intstructions on how to use it are included in the gist.&lt;/p&gt;

&lt;p&gt;This will start up a server, allocate it a public IP, and map the SSH port. Then when prompted, it will then tear this environment down.&lt;/p&gt;

&lt;h2 id='i_want_to_use_it_myself'&gt;I want to use it myself!&lt;/h2&gt;

&lt;p&gt;Currently, the code hasn&amp;#8217;t been submitted upstream, so you will need to work directly against the git repo. To do this, add this to your Gemfile:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gem &amp;#39;fog&amp;#39;, :git =&amp;gt; &amp;quot;https://github.com/ninefold/fog.git&amp;quot;, :branch =&amp;gt; &amp;quot;ninefold&amp;quot;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can then bundle install. This is currently a moving target, so you may want to &amp;#8216;bundle update fog&amp;#8217; often to ensure you&amp;#8217;re up to date.&lt;/p&gt;

&lt;p&gt;See the &lt;a href='https://gist.github.com/ee5b65a8ed778ce61963'&gt;gist&lt;/a&gt; for an example on how to interact with the API&lt;/p&gt;

&lt;p&gt;You can also check out the repository, build install it, but this will override your system install - I&amp;#8217;d reccomend using bundler.&lt;/p&gt;

&lt;p&gt;If you want an interactive shell to experiment with the API:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone https://github.com/ninefold/fog.git ninefold-fog
cd ninefold-fog
bundle install&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then set your API credentials in ~/.fog like in the &lt;a href='https://gist.github.com/ee5b65a8ed778ce61963'&gt;gist&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;bundle exec bin/fog&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can then interact with the Ninefold API via Ninefold&lt;span&gt;:compute&lt;/span&gt;. Some examples:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt; Ninefold[:compute].servers.all

&amp;gt;&amp;gt; Ninefold[:compute].list_networks

&amp;gt;&amp;gt; Ninefold[:compute].list_templates(:templatefilter =&amp;gt; &amp;#39;executable&amp;#39;)

&amp;gt;&amp;gt; Ninefold[:compute].list_service_offerings

&amp;gt;&amp;gt; Ninefold[:compute].servers.new(:templateid =&amp;gt; 421, :serviceofferingid =&amp;gt; 67, :zoneid =&amp;gt; 1)&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id='how_does_this_all_work_anyway'&gt;How does this all work anyway?&lt;/h2&gt;

&lt;p&gt;Via fog, items can be exposed in two ways. Requests, which map directly to the API. For naming convention reasons, we map the CamelCase API methods to underscore_methods. There are also Models, which map items at a higher level, and follow a set of fog conventions to make code somewhat portable across cloud providers.&lt;/p&gt;

&lt;p&gt;At all times it will be handy to keep the API reference handy as we are wrapping that, it can be found at &lt;a href='https://ninefold.com/support/display/SPT/API+Documentation'&gt;https://ninefold.com/support/display/SPT/API+Documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The best way to see the requests in action is via the tests at &lt;a href='https://github.com/ninefold/fog/tree/ninefold/tests/compute/requests/ninefold'&gt;https://github.com/ninefold/fog/tree/ninefold/tests/compute/requests/ninefold&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For interacting via the models, see the example &lt;a href='https://gist.github.com/ee5b65a8ed778ce61963'&gt;gist&lt;/a&gt; and the &lt;a href='http://fog.io'&gt;fog&lt;/a&gt; documentation&lt;/p&gt;

&lt;h2 id='im_having_problems'&gt;I&amp;#8217;m having problems!&lt;/h2&gt;

&lt;p&gt;If you find any bugs or have any feature requests, please log them at &lt;a href='https://github.com/ninefold/fog/issues'&gt;https://github.com/ninefold/fog/issues&lt;/a&gt;. If you just want to have a chat about how this works, or how you can use it, feel free to &lt;a href='/contact'&gt;contact&lt;/a&gt; me.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Compass with Rails 3 on Heroku</title>
   <link href="http://lstoll.net/2010/06/08/compass-with-rails-3-on-heroku.html"/>
   <updated>2010-06-08T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2010/06/08/compass-with-rails-3-on-heroku</id>
   <content type="html">&lt;h1 id='compass_with_rails_3_on_heroku'&gt;Compass with Rails 3 on Heroku&lt;/h1&gt;
&lt;p class='meta'&gt;8/6/2010&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve noticed plenty of posts around the net on how to get this to work, but none of them worked as is for me on a Rails 3 Beta 3 app using Compass and the Compass 960 plugin&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s my cobbled together solution - it&amp;#8217;s also a little simpler than some, as it doesn&amp;#8217;t try and do things different for heroku and local dev - it keeps it the same, and seems to work OK.&lt;/p&gt;

&lt;p&gt;1) Make sure you are using the latest gems&lt;/p&gt;
&lt;script src='http://gist.github.com/428746.js?file=Gemfile'&gt;/**/&lt;/script&gt;
&lt;p&gt;2) Make sure config/compass.rb has any plugins referenced, and set it&amp;#8217;s css_dir to tmp/stylesheets - this is writable on heroku.&lt;/p&gt;
&lt;script src='https://gist.github.com/428746.js?file=config/compass.rb'&gt;/**/&lt;/script&gt;
&lt;p&gt;3) Create a initializer in config/initializers/stylesheets.rb , and set it to serve the generated stylesheets from tmp/stylesheets under /stylesheets . This has to be loaded before the Rack::Sendfile middleware, otherwise it will try to X-Sendfile the CSS file which doesn&amp;#8217;t work on Heroku, rather than just rendering it&amp;#8217;s contents.&lt;/p&gt;
&lt;script src='https://gist.github.com/428746.js?file=config/compass.rb'&gt;/**/&lt;/script&gt;</content>
 </entry>
 
 <entry>
   <title>Google App Engine XMPP in Play Framework</title>
   <link href="http://lstoll.net/2010/05/10/google-app-engine-xmpp-in-play-framework.html"/>
   <updated>2010-05-10T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2010/05/10/google-app-engine-xmpp-in-play-framework</id>
   <content type="html">&lt;h1 id='google_app_engine_xmpp_in_play_framework'&gt;Google App Engine XMPP in Play Framework&lt;/h1&gt;
&lt;p class='meta'&gt;8/6/2010&lt;/p&gt;
&lt;p&gt;Google&amp;#8217;s documentation for receiving XMPP messages on App Engine involves running the HttpServletRequest through XMPPServiceFactory.parseMessage to extract the details, however on Play you don&amp;#8217;t get access to the HttpServletRequest, so you can&amp;#8217;t use their message parser. Fortunately the message is really just POSTed form data, so you can easily extract it in a handler bound to &amp;#8220;POST /_ah/xmpp/message/chat/&amp;#8221; like this:&lt;/p&gt;
&lt;script src='http://gist.github.com/395330.js'&gt;/**/&lt;/script&gt;</content>
 </entry>
 
 <entry>
   <title>Displaying your Location from Twitter on your Site</title>
   <link href="http://lstoll.net/2010/05/08/displaying-your-location-from-twitter-on-your-site.html"/>
   <updated>2010-05-08T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2010/05/08/displaying-your-location-from-twitter-on-your-site</id>
   <content type="html">&lt;h1 id='displaying_your_location_from_twitter_on_your_site'&gt;Displaying your Location from Twitter on your Site&lt;/h1&gt;
&lt;p class='meta'&gt;8/6/2010&lt;/p&gt;
&lt;p&gt;I was giving this site a little tweak, and one thing I wanted to add was my current location to my contact details - I move around a lot, and getting calls at stupid hours was begging to get a little annoying.&lt;/p&gt;

&lt;p&gt;The catch was, I didn&amp;#8217;t want to have to update this information manually all the time - it would get tiresome quickly, and I would end up letting it go stale. I usually geotag tweets semi-regularly from my phone, so I figured that would be a great place to get the data.&lt;/p&gt;

&lt;p&gt;I sat down, and whipped up a quick &lt;a href='http://www.sinatrarb.com/'&gt;Sinatra&lt;/a&gt; application that looks for the latest tweet with coordinates, extracts them, and uses the google reverse geocoding service to determine the city name. To make it a little less stalkerish I kept the city as the finest level of granularity. This is then exported as a simple little JSON-P Service, as well as a redirect to a map of the location.&lt;/p&gt;

&lt;p&gt;I deployed it to &lt;a href='http://heroku.com'&gt;Heroku&lt;/a&gt; like usual, I love how simple they make it to get an app up and running. The running app can be found at &lt;a href='http://whereami.lds.li'&gt;http://whereami.lds.li&lt;/a&gt;, and the code is on github at &lt;a href='http://github.com/lstoll/whereami'&gt;http://github.com/lstoll/whereami&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I integrate it in to this site with the following script:&lt;/p&gt;
&lt;script src='http://gist.github.com/393747.js'&gt;/**/&lt;/script&gt;</content>
 </entry>
 
 <entry>
   <title>Ubuntu 10.04 Vagrant Base Boxes</title>
   <link href="http://lstoll.net/2010/05/07/ubuntu-1004-vagrant-base-boxes.html"/>
   <updated>2010-05-07T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2010/05/07/ubuntu-1004-vagrant-base-boxes</id>
   <content type="html">&lt;h1 id='ubuntu_1004_vagrant_base_boxes'&gt;Ubuntu 10.04 Vagrant Base Boxes&lt;/h1&gt;
&lt;p class='meta'&gt;07/05/2010&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve made a pair of base boxes for Ubuntu 10.04 Server (Lucid Lynx), one 32 bit, one 64 bit.&lt;/p&gt;

&lt;p&gt;They are set up as per the guide, with chef 0.8.10 installed for provisioning. It&amp;#8217;s using the packaged ruby, with a custom installed rubygems as /usr/bin/gem. It also has the 3.1.6 additions, and is set up with the normal public SSH keys&lt;/p&gt;

&lt;p&gt;You can add them by running:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;32 Bit&lt;/p&gt;

&lt;p&gt;$ vagrant box add lucid32 http://s3.lds.li/vagrant/lucid32.box&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;64 Bit&lt;/p&gt;

&lt;p&gt;$ vagrant box add lucid64 http://s3.lds.li/vagrant/lucid64.box&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I intend to update them occasionally as new versions of chef are released, will package updates as needed.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Sync File Creation Date with EXIF Date on OS X</title>
   <link href="http://lstoll.net/2010/05/07/sync-file-creation-date-with-exif-date-on-osx.html"/>
   <updated>2010-05-07T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2010/05/07/sync-file-creation-date-with-exif-date-on-osx</id>
   <content type="html">&lt;h1 id='sync_file_creation_date_with_exif_date_on_os_x'&gt;Sync File Creation Date with EXIF Date on OS X&lt;/h1&gt;
&lt;p class='meta'&gt;19/05/2011&lt;/p&gt;
&lt;p&gt;So I could order my images in the Finder and use Smart Folders based on the created date of the image, I hacked this together to update the file creation date to match the EXIF date. For Mac OS X only.&lt;/p&gt;
&lt;script src='http://gist.github.com/310413.js?file=exifDateSync.rb'&gt;/**/&lt;/script&gt;
&lt;p&gt;See &lt;a href='http://gist.github.com/310413'&gt;http://gist.github.com/310413&lt;/a&gt; for all the code.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Simple node.js based http router</title>
   <link href="http://lstoll.net/2010/05/07/simple-nodejs-based-http-router.html"/>
   <updated>2010-05-07T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2010/05/07/simple-nodejs-based-http-router</id>
   <content type="html">&lt;h1 id='simple_nodejs_based_http_router'&gt;Simple node.js based http router&lt;/h1&gt;
&lt;p class='meta'&gt;19/05/2011&lt;/p&gt;
&lt;p&gt;Can be used to do a lookup based on the URL or incoming connection details, and route to the appropriate backend&lt;/p&gt;
&lt;script src='http://gist.github.com/311813.js?file=streaming_proxy.js'&gt;/**/&lt;/script&gt;</content>
 </entry>
 
 <entry>
   <title>Bulk deleting tumblr posts</title>
   <link href="http://lstoll.net/2009/11/05/bulk-deleting-tumblr-posts.html"/>
   <updated>2009-11-05T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2009/11/05/bulk-deleting-tumblr-posts</id>
   <content type="html">&lt;h1 id='bulk_deleting_tumblr_posts'&gt;Bulk deleting tumblr posts&lt;/h1&gt;
&lt;p class='meta'&gt;19/05/2011&lt;/p&gt;
&lt;p&gt;Because tumblr doesn&amp;#8217;t let you change the default blog, I wanted to clear out the old original blog I had to re-use for this site. Which brought me to the other problem - tumblr provide no way to batch delete posts, and will over 1,000 items in there I wasn&amp;#8217;t going to sit around and delete each one by hand. So here&amp;#8217;s a quick script I wrote, I hope it&amp;#8217;s useful to someone.&lt;/p&gt;
&lt;script src='http://gist.github.com/386253.js?file=bulk_delete_tumblr_posts.rb'&gt;/**/&lt;/script&gt;</content>
 </entry>
 
 <entry>
   <title>Enabling iPhone 3.0 Tethering and MMS on Three UK (Updated)</title>
   <link href="http://lstoll.net/2009/06/14/enable-tethering-mms-three-uk-updated.html"/>
   <updated>2009-06-14T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2009/06/14/enable-tethering-mms-three-uk-updated</id>
   <content type="html">&lt;h1&gt;Enabling iPhone 3.0 Tethering and &lt;span class=&quot;caps&quot;&gt;MMS&lt;/span&gt; on Three UK (Updated)&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;14/06/2009 &amp;#8211; London, UK&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;br /&gt;
I&amp;#8217;ve created TetherMe, a site for tethering your iPhone. Support for Australian Carriers (Telstra, Optus, Vodafone, Three) plus a few UK carriers, and Swisscom. Will add more soon, or you can add your own &lt;span class=&quot;caps&quot;&gt;APN&lt;/span&gt;. You can find the site at &lt;a href=&quot;http://tetherme.lstoll.net&quot;&gt;http://tetherme.lstoll.net&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The iPhone 3.0 Software is almost upon us, with some features I&amp;#8217;ve been looking forward to &amp;#8211; including tethering and &lt;span class=&quot;caps&quot;&gt;MMS&lt;/span&gt;. Unfortunately, the tethering feature has been limited to those carriers that officially carry the iPhone, and wish to allow their users to use it. This is unfortunate for those of us who have paid to unlock our phone, and are using an alternate carrier &amp;#8211; as the feature never gets enabled this. There is a way around this however &amp;#8211; a .mobileconfig file that sets the APN&amp;#8217;s up correctly. If you&amp;#8217;re using 3 UK, browse to this page on your phone, and &lt;a href=&quot;http://github.com/lstoll/iphone-carrier-settings/raw/master/3UKTether.mobileconfig&quot;&gt;click on this link&lt;/a&gt; (Or you can save it, and mail to your phone). This will provision your phone, and enable tethering. Works great with the 5 pounds a month unlimited internet add-on. For those on other carriers, take a look at the 3UKTether.mobileconfig file here: &lt;a href=&quot;http://github.com/lstoll/iphone-carrier-settings/tree/master&quot;&gt;http://github.com/lstoll/iphone-carrier-settings/tree/master&lt;/a&gt;, it&amp;#8217;s pretty easy to set it up yourself. Then, just email the file to your phone, and open it. Enabling &lt;span class=&quot;caps&quot;&gt;MMS&lt;/span&gt; is easier &amp;#8211; On your phone, go to Settings &amp;#8594; General &amp;#8594; Network &amp;#8594; Cellular Data, and enter the following details in the dialog:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;span class=&quot;caps&quot;&gt;MMS&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;APN&lt;/span&gt;: three.co.uk&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;caps&quot;&gt;MMSC&lt;/span&gt;: mms.um.three.co.uk:10021/mmsc&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;caps&quot;&gt;MMS&lt;/span&gt; Proxy: mms.three.co.uk:8799&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After I entered this I had to restart my phone &amp;#8211; once it came back, &lt;span class=&quot;caps&quot;&gt;MMS&lt;/span&gt; was working. Check by making sure there is a camera icon in the new message box, like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://static.lstoll.net/skitch/iphone-mms-icon.jpg&quot;/&gt;&lt;/p&gt;
&lt;p&gt;and try sending a message.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Announcing the rb-gae-support gem</title>
   <link href="http://lstoll.net/2009/04/14/announcing-rb-gae-support.html"/>
   <updated>2009-04-14T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2009/04/14/announcing-rb-gae-support</id>
   <content type="html">&lt;h1&gt;Announcing the rb-gae-support gem&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;14/04/2009 &amp;#8211; Salzburg, Austria&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;br /&gt;
Some googlers have gone out and done a much more complete verion of this, so this project is now defunct. see &lt;a href=&quot;http://code.google.com/p/appengine-jruby/&quot;&gt;http://code.google.com/p/appengine-jruby/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Recently Google announced Java support for Google App Engine &amp;#8211; which opened the floodgates for me. I&amp;#8217;ve always loved the idea of &lt;span class=&quot;caps&quot;&gt;GAE&lt;/span&gt;, but have never been that in to Python. Now however not only can I work in Java, but also other &lt;span class=&quot;caps&quot;&gt;JVM&lt;/span&gt; languages, including one of my favorites, Ruby. &lt;span class=&quot;caps&quot;&gt;GAE&lt;/span&gt; is not without limitations though, so some things have to be done a little differently especially &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; access. It also provides some useful services, like User authentication and Memcached. To make this all easier, I&amp;#8217;ve started on a gem called rb-gae-support. At the moment it is very alpha, however it monkey patches enough Net:&lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; to get it working on &lt;span class=&quot;caps&quot;&gt;GAE&lt;/span&gt; (tested with a few gems). It also provides easier wrappers for the User and Memcache services, to make it fit in a little better.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s still in active development, so expect it to become much more stable and have more functionality soon. Patches are always welcome too! I&amp;#8217;m also working on a template to make it easier to get started with and develop &lt;span class=&quot;caps&quot;&gt;GAE&lt;/span&gt; apps, that will avoid all the restarts in the dev env. Hopefully, I&amp;#8217;ll wrap this into some kind of generator.&lt;/p&gt;
&lt;p&gt;For now, you can install the gem &lt;br /&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;&lt;br /&gt;
  sudo gem install rb-gae-support&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
, see the RDoc at &lt;a href=&quot;http://rb-gae-support.rubyforge.org&quot;&gt;http://rb-gae-support.rubyforge.org&lt;/a&gt; and grab the code from &lt;a href=&quot;http://github.com/lstoll/rb-gae-support&quot;&gt;http://github.com/lstoll/rb-gae-support&lt;/a&gt;. The template app I&amp;#8217;m working on can be found at &lt;a href=&quot;http://github.com/lstoll/rack-gae-template&quot;&gt;http://github.com/lstoll/rack-gae-template&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So please try it out, and let me know how you go!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Triple J on your iPhone.</title>
   <link href="http://lstoll.net/2009/03/14/streaming-radio-to-iphone-safari.html"/>
   <updated>2009-03-14T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2009/03/14/streaming-radio-to-iphone-safari</id>
   <content type="html">&lt;h1&gt;Triple J on your iPhone.&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;14/03/2009 &amp;#8211; Islington, London, UK.&lt;/p&gt;
&lt;p&gt;A month or so ago, I set up a little site that let&amp;#8217;s you stream Triple J to the iPhone. I&amp;#8217;ve since been using it more, so I&amp;#8217;ve decided to finally release the code, and push the site a little more.&lt;/p&gt;
&lt;p&gt;Firstly, you can visit the site on your iPhone at &lt;a href=&quot;http://r.lstoll.net&quot;&gt;r.lstoll.net&lt;/a&gt;. Don&amp;#8217;t try it on desktop Safari &amp;#8211; it seems to hang. It currently only has Triple J, however I can add more stations on request &amp;#8211; providing they have a MP3 stream available.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve also pushed the code up to &lt;a href=&quot;http://hg.lstoll.net/r.lstoll.net&quot;&gt;http://hg.lstoll.net/r.lstoll.net&lt;/a&gt;. It&amp;#8217;s a pretty basic Sinatra application, pulling the config out of a yaml file. It could probably use some improvement, but it works so I&amp;#8217;m happy. It demonstrates a custom body object to stream data back to a user, you can see it in &lt;a href=&quot;http://hg.lstoll.net/r.lstoll.net/src/tip/lib/radio_streamer.rb&quot;&gt;lib/radio_streamer.rb&lt;/a&gt;. Unfortunately some ruby servers don&amp;#8217;t support streaming the response, notably thin and passenger &amp;lt; 2.1.1, so if you plan on playing with it I&amp;#8217;d recommend using mongrel or the latest passenger.&lt;/p&gt;
&lt;p&gt;Another interesting point in the code is that it&amp;#8217;s a Sinatra app, developed in Netbeans &amp;#8211; including running and debugging, something which there isn&amp;#8217;t too much info out there about. If you&amp;#8217;re trying to develop Sinatra apps in Netbeans, it&amp;#8217;s worth a look at the layout.&lt;/p&gt;
&lt;p&gt;The code definitely needs some enhancements &amp;#8211; currently each user stream opens a new stream to the source, which isn&amp;#8217;t terribly efficient, plus stream transcoding so WM and &lt;span class=&quot;caps&quot;&gt;AAC&lt;/span&gt; sources can be added would be good too.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Darwin Streaming Server on Ubuntu.</title>
   <link href="http://lstoll.net/2009/03/13/darwin-streaming-server-on-ubuntu.html"/>
   <updated>2009-03-13T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2009/03/13/darwin-streaming-server-on-ubuntu</id>
   <content type="html">&lt;h1&gt;Darwin Streaming Server on Ubuntu.&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;13/03/2009 &amp;#8211; Islington, London, UK.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 3 (11/11/2009):&lt;/strong&gt;&lt;br /&gt;
I&amp;#8217;ve moved the download links to &lt;a href=&quot;http://github.com/lstoll/dss/downloads&quot;&gt;http://github.com/lstoll/dss/downloads&lt;/a&gt; &amp;#8211; please see there for more information.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 2 (24/10/2009):&lt;/strong&gt;&lt;br /&gt;
I&amp;#8217;ve got a 64 bit version of the package available now as well. Please note it has had very little testing &amp;#8211; please try it out, and report any bugs you find. You can download it here: &lt;a href=&quot;http://github.com/lstoll/dss&quot;&gt;http://github.com/lstoll/dss&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;br /&gt;
There is now an issue tracker at &lt;a href=&quot;http://github.com/lstoll/dss/issues&quot;&gt;http://github.com/lstoll/dss/issues&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve made available a pre-built .dpkg for running the latest version of Darwin Streaming Server on Ubuntu. This has been tested on 8.04, will probably work on other versions. Currently only supports 32bit versions &amp;#8211; if you only have servers running 64bit Ubuntu, you can use xen to run a 32bit instance under this. It is mostly the Apple released code, with a few linux compatibility patches from the mailing list and some changes by myself to make it work behind Cisco load balancers, and to be properly packed for Ubuntu (including startup items). It&amp;#8217;s been running in production for a while, so should be fairly stable. You can download the binary package (you will need to gunzip it first) from &lt;a href=&quot;http://github.com/lstoll/dss/downloads&quot;&gt;http://github.com/lstoll/dss/downloads&lt;/a&gt;, access the source at &lt;a href=&quot;http://github.com/lstoll/dss/&quot;&gt;http://github.com/lstoll/dss/&lt;/a&gt;, and report any issues relating to this build to me &lt;a href=&quot;mailto:lstoll@lstoll.net&quot;&gt;lstoll@lstoll.net&lt;/a&gt;. This isn&amp;#8217;t a replacement for the Apple bug tracker &amp;#8211; things should also be reported there as well.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Stop Leopard changing your hostname</title>
   <link href="http://lstoll.net/2009/03/11/stop-leopard-changing-hostname.html"/>
   <updated>2009-03-11T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2009/03/11/stop-leopard-changing-hostname</id>
   <content type="html">&lt;h1&gt;Stop Leopard changing your hostname&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;11/03/2009 &amp;#8211; Islington, London, UK.&lt;/p&gt;
&lt;p&gt;One annoying thing in Leopard is that by default it is happy to take on the &lt;span class=&quot;caps&quot;&gt;DNS&lt;/span&gt; (or other name resolution) provided hostname, which messes up the terminal prompt, and makes a whole bunch of applications assume that is your hostname, which is annoying when it&amp;#8217;s something like &amp;#8220;77-101-168-198&amp;#8221;. This hasn&amp;#8217;t been a problem for me in the past as I&amp;#8217;ve usually been on a network behind &lt;span class=&quot;caps&quot;&gt;NAT&lt;/span&gt;, but here I&amp;#8217;m on a direct cable connection, and it is all over the place. To fix this, run the following (replacing &amp;#8216;linc&amp;#8217; with your desired hostname)&lt;/p&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;
  sudo hostname linc.local
  sudo scutil --set HostName linc.local
  sudo scutil --set LocalHostName linc
&lt;/pre&gt;
&lt;p&gt;Once this is done, the name should stick permanently.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Shell Meme</title>
   <link href="http://lstoll.net/2008/04/18/shell-meme.html"/>
   <updated>2008-04-18T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2008/04/18/shell-meme</id>
   <content type="html">&lt;h1&gt;Shell Meme&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;18/04/2008 &amp;#8211; Sydney, &lt;span class=&quot;caps&quot;&gt;NSW&lt;/span&gt;, AU.&lt;/p&gt;
&lt;p&gt;I can&amp;#8217;t remember where I saw this first&amp;#8230;&lt;/p&gt;
&lt;p&gt;I ran&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;history|awk '{a[$2]++} END{for(i in a){printf &quot;%5d\t%s\n &quot;,a[i],i}}'|sort -rn|head&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and got this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;100	cd
62	ls
60	git
28	ssh
26	hg
19	mate
17	psql
15	sudo
15	mv
14	rake&lt;/pre&gt;&lt;p&gt;&lt;/code&gt;&lt;br /&gt;
Looks like I&amp;#8217;ve spent too much time looking for things, and not enough time working on them.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Passenger (A.K.A. mod_rails_)</title>
   <link href="http://lstoll.net/2008/04/12/passenger-aka-mod-rails.html"/>
   <updated>2008-04-12T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2008/04/12/passenger-aka-mod-rails</id>
   <content type="html">&lt;h1&gt;Passenger (A.K.A. mod_rails_)&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;12/04/2008 &amp;#8211; Sydney, &lt;span class=&quot;caps&quot;&gt;NSW&lt;/span&gt;, AU.&lt;/p&gt;
&lt;p&gt;Passenger is now available for download &amp;#8211; http://www.modrails.com . If you haven&amp;#8217;t heard of it, is basically an apache module for running rails apps &amp;#8211; nice and easily. I&amp;#8217;ve just moved it over to this site, and it was incredibly easy. The install on my ubuntu server went like this:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;sudo apt-get install apache2-prefork-dev libapr1-dev
sudo gem install passenger
passenger-install-apache2-module&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I then added the apache config lines to the end of the apache config, and set my site up like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;VirtualHost *:80&amp;gt;
ServerName lstoll.net
DocumentRoot /home/xxx/sites/lstoll.net/current/public
ServerAdmin xxx@xxx.net
ErrorLog /home/xxx/logs/lstoll.net_error.log
CustomLog /home/xxx/logs/lstoll.net_access.log combined
&amp;lt;/VirtualHost&amp;gt;&lt;/pre&gt;&lt;p&gt;&lt;/code&gt;&lt;br /&gt;
Then, when apache started up it automatically started the rails app, and it just worked. It&amp;#8217;s simple to use with capistrano, here&amp;#8217;s my deploy tasks from deploy.rb:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;namespace :deploy do
  desc &quot;Custom restart task for passenger&quot;
  task :restart, :roles =&amp;gt; :app, :except =&amp;gt; { :no_release =&amp;gt; true } do
    run &quot;touch #{deploy_to}/current/tmp/restart.txt&quot;
  end
 
  desc &quot;Custom start task for passenger&quot;
  task :start, :roles =&amp;gt; :app do
    # Don't need to do anything, it's automatic
  end
 
  desc &quot;Custom stop task for passenger&quot;
  task :stop, :roles =&amp;gt; :app do
    # currently no way I know of to 'stop' the app
  end
 
end&lt;/pre&gt;&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Once that is done, capistrano can flag to passenger to restart the app.&lt;/p&gt;
&lt;p&gt;A bit of casual benchmarking shows it&amp;#8217;s fast too. I&amp;#8217;m very happy this is out there, it makes running rails apps as easy as &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; &amp;#8211; saving all the messing around with mongrel/thin/monit. It also works with rails caching, so so more messing around with rewrite rules to get cached files to be read right off disk. This should hopefully make rails better on shared hosts, and lower the barrier of entry. Only downside is that this is currently rails only &amp;#8211; so for merb/camping/anything else the old way is still needed. I&amp;#8217;m hoping that soon passenger will support rack, or mod_rack/mod_rubinius will come out, so this ease is brought to all ruby frameworks.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Stand-alone ActiveRecord Migrations</title>
   <link href="http://lstoll.net/2008/04/07/stand-alone-active-record-migrations.html"/>
   <updated>2008-04-07T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2008/04/07/stand-alone-active-record-migrations</id>
   <content type="html">&lt;h1&gt;Stand-alone ActiveRecord Migrations&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;4/7/2008 &amp;#8211; Sydney&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; &lt;a href=&quot;http://gabrito.com/post/standalone-migrations-using-rails-migrations-in-non-rails-projects&quot;&gt;Todd Huss&lt;/a&gt; has created a github project based on this &amp;#8211; probably worth a look. You can find it &lt;a href=&quot;http://github.com/thuss/standalone-migrations&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Currently working on a merb project using datamapper &amp;#8211; nice framework, but the auto-migrate feature is fairly limited &amp;#8211; So I decided to hook up ActiveRecord&amp;#8217;s migrations into the app. This code could be equally as easily adapted in to anything else.&lt;/p&gt;
&lt;p&gt;First, I created a folder for the migrations to live in:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;mkdir -p db/ar_migrations&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I then appended a few tasks ripped out of Rails and slightly tweaked to the Rakefile:&lt;/p&gt;
&lt;script src=&quot;http://gist.github.com/47783.js&quot;&gt;&lt;/script&gt;&lt;p&gt;These will read from database.yml in config/ , so make sure you&amp;#8217;ve got datamapper set up.&lt;/p&gt;
&lt;p&gt;Lastly, Lets create an example migration to create the datamapper sessions table in db/ar_migrations/001_create_dm_session_table.rb:&lt;/p&gt;
&lt;script src=&quot;http://gist.github.com/47785.js&quot;&gt;&lt;/script&gt;&lt;p&gt;Once this is done, you can run rake db:migrate , and the DB will get the sessions table added. The db:schema:load task is also there, so you should use this when you first deploy your app to a new server. The naming is also consistent with rails, so capistrano should interact with it out of the box, with the exception that the environment to load/migrate needs to be called MERB_ENV instead of RAILS_ENV&lt;/p&gt;
&lt;p&gt;When creating additional migrations you will need to follow the &amp;#8216;proper&amp;#8217; naming scheme: the filename should start with an incrementing three digit number, and the rest should be a &amp;#8216;flattened&amp;#8217; version of the class name. (i.e migration class AddPostTable becomes add_post_table).&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Installing MySQL gem on Leopard with MacPorts MySQL</title>
   <link href="http://lstoll.net/2007/10/30/installing-mysql-gem-on-leopard-with-macports-mysql.html"/>
   <updated>2007-10-30T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2007/10/30/installing-mysql-gem-on-leopard-with-macports-mysql</id>
   <content type="html">&lt;h1&gt;Installing MySQL gem on Leopard with MacPorts MySQL&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;30/10/2007 &amp;#8211; Sydney, &lt;span class=&quot;caps&quot;&gt;NSW&lt;/span&gt;, AU.&lt;/p&gt;
&lt;p&gt;The MySQL Gem won&amp;#8217;t install directly on a Leopard machine using a Macports install of mysql (or any other MySQL install method I can think of) because by default gem will try built a universal gem, however the MySQL install will only have libraries for your current platform. So we need to force the architecture the gem is built for.&lt;/p&gt;
&lt;p&gt;To install on a Intel Machine:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;sudo bash -c &quot;ARCHFLAGS='-arch i386' gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5&quot;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To install on a PowerPC Machine:&lt;/p&gt;
&lt;pre class=&quot;terminal&quot;&gt;&lt;code&gt;sudo bash -c &quot;ARCHFLAGS='-arch i386' gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5&quot;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Make sure you select the newest ruby (not mswin32) version.&lt;br /&gt;
If you are not using a Macports MySQL Install, find where mysql_config lives and update the above command.&lt;/p&gt;
&lt;p&gt;More info on the bundled Ruby under Leopard can be found here: &lt;a href=&quot;http://trac.macosforge.org/projects/ruby/wiki/WhatsNewInLeopard&quot;&gt;http://trac.macosforge.org/projects/ruby/wiki/WhatsNewInLeopard&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Locale Errors on Ubuntu</title>
   <link href="http://lstoll.net/2007/08/07/locale-errors-on-ubuntu.html"/>
   <updated>2007-08-07T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2007/08/07/locale-errors-on-ubuntu</id>
   <content type="html">&lt;h1&gt;Locale Errors on Ubuntu&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;7/8/2007 &amp;#8211; Sydney, &lt;span class=&quot;caps&quot;&gt;NSW&lt;/span&gt;, AU.&lt;/p&gt;
&lt;p&gt;I set up a new Ubuntu &lt;span class=&quot;caps&quot;&gt;XEN&lt;/span&gt; VM, and installed a few packages.. then started getting errors like this all over the place:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

LANGUAGE = (unset),

LC_ALL = (unset),

LANG = 'en_AU.UTF-8'

are supported and installed on your system.

perl: warning: Falling back to the standard locale ().

locale: Cannot set LC_CTYPE to default locale: No such file or directory

locale: Cannot set LC_MESSAGES to default locale: No such file or directory

locale: Cannot set LC_ALL to default locale: No such file or directory&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Seems that at some point all the entries get screwed up for setting locales. I ran sudo apt-get install language-pack-en-base , and then everything was fineso this ease is brought to all ruby frameworks.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>VMWare Server Console Username/Password on OpenSUSE 10.2 x64</title>
   <link href="http://lstoll.net/2007/05/12/vmware-server-colsole-invalid-username-and-password-on-opensuse-10-2-x64.html"/>
   <updated>2007-05-12T00:00:00+00:00</updated>
   <id>http://tom.preston-werner.com/2007/05/12/vmware-server-colsole-invalid-username-and-password-on-opensuse-10-2-x64</id>
   <content type="html">&lt;h1&gt;VMWare Server Console Username/Password on OpenSUSE 10.2 x64&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;12/5/2007 &amp;#8211; Sydney, &lt;span class=&quot;caps&quot;&gt;NSW&lt;/span&gt;, AU.&lt;/p&gt;
&lt;p&gt;I tried installing VMware Server 1.0.3 onto OpenSuse 10.2, and came across an issue &amp;#8211; It wouldn&amp;#8217;t let me log in as root (or anything), telling me that I had an invalid username or password. To get it working I had to use yast to install pam-modules-32bit, then edit /etc/vmware/pam.d/vmware-authd , and replace \%pamdir\% with /usr/lib/vmware/lib/libpam.so.0/security . You should then be right to go, straight away!&lt;/p&gt;</content>
 </entry>
 
 
</feed>
