<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title>coding in the rain</title>
	<link type="application/atom+xml" href="http://ascarter.net/atom.xml" rel="self" />
	<link type="text/html" href="http://ascarter.net/" rel="alternate" />
	<id>tag:ascarter.net,2009-12-31:/atom.xml</id>
	<updated>2010-02-22T22:50:31-08:00</updated>
	
	<entry>
		<title>Homebrew for OS X</title>
		<author>
			<name>Andrew Carter</name>
		</author>
		<link type="text/html" href="http://ascarter.net/2010/02/22/homebrew-for-os-x.html" rel="alternate" />
		<published>2010-02-22T22:10:58-08:00</published>
		<updated>2010-02-22T22:10:58-08:00</updated>
		<id>tag:ascarter.net,2010-02-22:/2010/02/22/homebrew-for-os-x</id>
		<content type="html">&lt;p&gt;Most Unix-based platforms have at least one package management system. Some are like &lt;a href='http://debian.org'&gt;Debian&lt;/a&gt; where the package system is one with the operating system. Others are bolted onto the system.&lt;/p&gt;

&lt;p&gt;Mac OS X has had two package systems for many years. &lt;a href='http://www.finkproject.org'&gt;Fink&lt;/a&gt; is a port of the Debian apt system. &lt;a href='http://www.macports.org'&gt;Macports&lt;/a&gt; is primarily a port of the &lt;a href='http://www.freebsd.org'&gt;FreeBSD&lt;/a&gt; ports system. Unlike Linux, both of these are sandboxes that you run on top of the Apple supplied system. In many ways, this is not unlike &lt;a href='http://www.cygwin.com'&gt;Cygwin&lt;/a&gt; for Windows.&lt;/p&gt;

&lt;p&gt;In my opinion, both Fink and Macports suffer from the fact that neither makes an effort to integrate with the core operating system. I already have a tested version of Perl or Python on my system. I&amp;#8217;d rather the package system stuck with this as much as possible.&lt;/p&gt;

&lt;p&gt;Now there is a new package manager on the scene called &lt;a href='http://github.com/mxcl/homebrew'&gt;Homebrew&lt;/a&gt;. I think it is very promising. It is similar in approach to Macports in that you build recipes in a high level scripting language. Macports uses &lt;a href='http://www.tcl.tk/'&gt;TCL&lt;/a&gt; and Homebrew uses my favorite language &lt;a href='http://ruby-lang.org'&gt;Ruby&lt;/a&gt;. Both pull down a source package, configure it, and build the code. Both also manage dependencies and attempt to get other supporting libraries.&lt;/p&gt;

&lt;p&gt;There are three major differences. The first is that Homebrew is trying to augment the existing Mac OS X distribution from Apple. It uses what is already installed as much as it can. The other difference is that recipe development is very simple using Ruby. The last major improvement is that Homebrew is developed on &lt;a href='http://github.com'&gt;GitHub&lt;/a&gt; so forking and submitting recipes is trivial.&lt;/p&gt;

&lt;h1 id='changes_to_default_install'&gt;Changes to Default Install&lt;/h1&gt;

&lt;p&gt;I&amp;#8217;ve spent some time getting familiar with Homebrew the past week or so. I like what I&amp;#8217;ve seen but I don&amp;#8217;t completely agree with the recommended installation. I&amp;#8217;m offering my approach as an alternate.&lt;/p&gt;

&lt;p&gt;There are two things I don&amp;#8217;t agree with. The first is installing Homebrew in &lt;code&gt;/usr/local&lt;/code&gt;. Although Mac OS X surprisingly doesn&amp;#8217;t ship with a default &lt;code&gt;/usr/local&lt;/code&gt; directory, this path has such strong meaning to anyone who uses other Unix systems like Linux. I absolutely expect to download the source to &lt;code&gt;/usr/local/src&lt;/code&gt; and build it by hand.&lt;/p&gt;

&lt;p&gt;The second recommendation I don&amp;#8217;t agree with is to make the Homebrew directory user owned instead of root. This is probably more a matter of preference but I&amp;#8217;d rather mimic the typical behavior of root owning software available system wide. The reasons the Homebrew team give are valid but I guess I&amp;#8217;m stuck in my ways.&lt;/p&gt;

&lt;h1 id='setting_up_homebrew'&gt;Setting up Homebrew&lt;/h1&gt;

&lt;p&gt;The author of Homebrew made a very good decision to allow it to be installed anywhere you want. So the first thing to do is pick where you want your Homebrew install to live. The approach is to put the software into a special directory called &lt;code&gt;HOMEBREW_PATH/Cellar&lt;/code&gt;. Any binaries are symlinked in &lt;code&gt;HOMEBREW/bin&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I recommend emulating what Macports does and creating a standalone location for Homebrew. I picked &lt;code&gt;/opt/homebrew&lt;/code&gt; for my install but you can chose whatever you want. I also use root as the owner so my commands will be using &lt;code&gt;sudo&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo mkdir -p /opt/homebrew&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next, bootstrap an initial install of Homebrew. You can either &lt;code&gt;git clone&lt;/code&gt; the repository directory or pull down a tarball of the master branch:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo -s
cd /opt
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C homebrew&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Since I&amp;#8217;ve chosen to install Homebrew into its own directory, I need to make the paths available. Mac OS X uses &lt;code&gt;path_helper&lt;/code&gt; as a way of defining the &lt;code&gt;PATH&lt;/code&gt; and &lt;code&gt;MANPATH&lt;/code&gt; settings. The &lt;code&gt;path_helper&lt;/code&gt; will read &lt;code&gt;/etc/paths&lt;/code&gt; and all entries in &lt;code&gt;/etc/paths.d&lt;/code&gt;. The files are nothing more than a path to add separated by newline. There is a similar arrangement of &lt;code&gt;/etc/manpaths&lt;/code&gt; and &lt;code&gt;/etc/manpaths.d&lt;/code&gt;. If you prefer, you can just add these to your &lt;code&gt;PATH&lt;/code&gt; and &lt;code&gt;MANPATH&lt;/code&gt; variable in your profile:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo -s
echo &amp;quot;/opt/homebrew/bin&amp;quot; &amp;gt; /etc/paths.d/homebrew
echo &amp;quot;/opt/homebrew/share/man&amp;quot; &amp;gt; /etc/manpaths.d/homebrew&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Start up a new shell and test out brew:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo brew list&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You should see nothing installed. Now try installing a package:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo brew install wget&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When it is complete, you should have a &lt;code&gt;/opt/homebrew/bin/wget&lt;/code&gt; symlinked to the binary. There are the typical package options (search, install, uninstall, list). Commands are in the form of &lt;code&gt;brew action formula&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The recipes files are simply Ruby scripts in the &lt;code&gt;HOMEBREW/Library/Formula&lt;/code&gt; directory. These files can be updated. To convert your Homebrew to a git clone:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo brew update&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Your Homebrew directory is now a git clone of the project. This means you can do all the normal cool git activities you want. Create a new branch to test out formula changes. Track other user&amp;#8217;s formulas by adding a git remote. Merge as you please. It is extremely flexible and elegant.&lt;/p&gt;

&lt;p&gt;Homebrew is relatively new. The package list is much smaller than Fink or Macports. But there is a lot of activity around the project and I&amp;#8217;ve already had great interactions with other users creating packages.&lt;/p&gt;

&lt;p&gt;I think the advantage of my layout is that Homebrew is isolated cleanly and I can selectively use it to add packages. I can still install and build software to &lt;code&gt;/usr/local&lt;/code&gt; with no conflicts. For example, I prefer the binary MySQL and Git installs over using the packages since I rely on these packages and don&amp;#8217;t want to deal with any issues building them. For other software like ImageMagick or ffmpeg, Homebrew is a great way to easily add it and keep it up to date.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Capistrano Boss</title>
		<author>
			<name>Andrew Carter</name>
		</author>
		<link type="text/html" href="http://ascarter.net/2010/01/27/capistrano-boss.html" rel="alternate" />
		<published>2010-01-27T22:51:00-08:00</published>
		<updated>2010-01-27T22:51:00-08:00</updated>
		<id>tag:ascarter.net,2010-01-27:/2010/01/27/capistrano-boss</id>
		<content type="html">&lt;p&gt;&lt;a href='http://capify.org'&gt;Capistrano&lt;/a&gt; is a very useful deployment management tool widely used for Ruby on Rails production managment. I&amp;#8217;ve used it for over 2 years to manage multiple environments including production, staging, and testing. It is easy to get started with and also easy to extend.&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s a tool that is so flexible that the initial reaction is to write a task for everything. The running joke on my team has been that for every question &amp;#8220;can I &amp;#8230;?&amp;#8221;, the answer is &amp;#8220;there&amp;#8217;s a task for that.&amp;#8221; Many times, it was true. Recently, we moved our application from Mongrel to Passenger. I took the opportunity to re-evaluate what tasks we needed. I eliminated all the dangerous stuff (like directly touching the database or loading up script/console via cap). I then extracted the most useful tasks.&lt;/p&gt;

&lt;p&gt;Originally, the extensions were implemented in the &lt;code&gt;lib&lt;/code&gt; folder or in a deployment plugin. Since plugins are not the way to go anymore for Rails, I decided to turn all of that into a gem. Using the fantastic new &lt;a href='http://gemcutter.org'&gt;Gemcutter&lt;/a&gt; tool, I created &lt;a href='http://github.com/ascarter/capistrano-boss'&gt;Capistrano-boss&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There are recipes split up in four namespaces: deploy, apache, passenger, and rails. Most are simple but there are a couple that I find very useful. First, apache and rails both support downloading logs (&lt;strong&gt;log:fetch&lt;/strong&gt;) and watching logs in real time (&lt;strong&gt;log:watch&lt;/strong&gt;). The realtime log feature is one we use very frequently. I can&amp;#8217;t even remember where I found the tip originally but it does a &lt;code&gt;tail -f&lt;/code&gt; and marks up the stream with the host and timestamp. It makes it very easy to watch activity on all your servers at once. On a busy server, it can get overwhelming. I intend to put in some filter options for this task at some point.&lt;/p&gt;

&lt;p&gt;The other useful recipes are for managing the &lt;code&gt;database.yml&lt;/code&gt; file. The recipe &lt;strong&gt;rails:config:database&lt;/strong&gt; creates a configuration in &lt;code&gt;#{shared_path}/config/database.yml&lt;/code&gt;. It will prompt for the database password and write it out. This allows you to checkin a clean database.yml without a password into source control. You can easily set it just once in the shared configuation location. When &lt;strong&gt;deploy&lt;/strong&gt; is run, the recipe &lt;strong&gt;rails:deploy:config&lt;/strong&gt; will symlink &lt;code&gt;#{shared_path}/config/database.yml&lt;/code&gt; to &lt;code&gt;#{current_path}/config/database.yml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;One other addition is an extension to the way the Subversion repository is determined. The readme explains it but the idea is that you can set &lt;code&gt;:branch&lt;/code&gt; or &lt;code&gt;:tag&lt;/code&gt; and have the repository path adjusted. We used it to set which tag to deploy on the cap command line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cap deploy -s tag=&amp;#39;myrelease&amp;#39;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It assumes the standard subversion layout (branches/tags/trunk) and defaults to using trunk. As of this week though, we have moved to a pure git source control system and (thankfully) will no longer need the subversion support.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m hoping people will fork and submit back their favorite deployment related recipes. My goal is for light weight tasks, not full on configuration management. I headed down that path and it wasn&amp;#8217;t good. Puppet or Chef is probably a beter solution for that. But many Rails applications don&amp;#8217;t need much configuration help and that&amp;#8217;s what I want in capistrano-boss. The source is on &lt;a href='http://github.com/ascarter/capistrano-boss'&gt;Github&lt;/a&gt; and the gem is published on &lt;a href='http://gemcutter.org/gems/capistrano-boss'&gt;Gemcutter&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Finding Installed Packages On Ubuntu</title>
		<author>
			<name>Andrew Carter</name>
		</author>
		<link type="text/html" href="http://ascarter.net/2010/01/15/finding-installed-packages-on-ubuntu.html" rel="alternate" />
		<published>2010-01-15T21:44:29-08:00</published>
		<updated>2010-01-15T21:44:29-08:00</updated>
		<id>tag:ascarter.net,2010-01-15:/2010/01/15/finding-installed-packages-on-ubuntu</id>
		<content type="html">&lt;p&gt;&lt;a href='http://ubuntu.com'&gt;Ubuntu&lt;/a&gt; uses the Debian &lt;a href='http://www.debian.org/doc/FAQ/ch-pkg_basics.en.html'&gt;package&lt;/a&gt; system. There are multiple applications for managing the packages on your system including &lt;a href='http://wiki.debian.org/Apt'&gt;Apt&lt;/a&gt;, &lt;a href='http://wiki.debian.org/Aptitude'&gt;aptitude&lt;/a&gt;, &lt;a href='http://wiki.debian.org/DebianPackageDocumentation'&gt;dpkg&lt;/a&gt;, and &lt;a href='http://www.nongnu.org/synaptic/'&gt;Synaptic&lt;/a&gt;. Each of these tools interacts with the &lt;code&gt;deb&lt;/code&gt; format package files.&lt;/p&gt;

&lt;p&gt;Synaptic is a great tool for managing packages in a GUI. But what about the command line? I run an older Dell PowerEdge 400SC as a server literally in a closet in my house. It&amp;#8217;s got power and a network cable so I manage it over SSH from my laptop or my Ubuntu desktop. For whatever reason, I never could figure out the right way to list packages already installed. I found two methods to list the packages.&lt;/p&gt;

&lt;h5 id='dpkgquery'&gt;dpkg-query&lt;/h5&gt;

&lt;p&gt;This tool lists the installed packages as well as some other information. It accepts a pattern for finding matching packages. In addition, it can show package status and all the files included in the package.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dpkg-query actions
-l, --list package-name-pattern...
	List packages matching given pattern.
-s, --status package-name...
	Report status of specified package.
-L, --listfiles package-name...
	List files installed to your system from package-name.
-S, --search filename-search-pattern...
	Search for a filename from installed packages.
-p, --print-avail package-name...
	Display details about package-name, as found in
	/var/lib/dpkg/available. Users of APT-based frontends
	should use apt-cache show package-name instead.&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The following is an example for the ruby package:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ dpkg-query --list ruby1.8
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name    Version            Description
+++-=======-==================-======================================================
ii  ruby1.8 1.8.7.174-1ubuntu1 Interpreter of object-oriented scripting language Ruby&lt;/code&gt;&lt;/pre&gt;

&lt;h5 id='aptshowversions'&gt;apt-show-versions&lt;/h5&gt;

&lt;p&gt;Another useful tool for listing both the installed packages and information on out-of-date packages is &lt;code&gt;apt-show-versions&lt;/code&gt;. It is not part of the base Ubuntu install but can easily be added:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ sudo apt-get install apt-show-versions&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The tool has many useful query options. It can show specific packages, match by a regex pattern, and list upgradeable packages:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Apt-Show-Versions v.0.16 (c) Christoph Martin

Usage:
 apt-show-versions         shows available versions of installed packages.

Options:
 -stf|--status-file=&amp;lt;file&amp;gt;  Use &amp;lt;file&amp;gt; as the dpkg status file instead
                            of /var/lib/dpkg/status
 -ld|list-dir=&amp;lt;directory&amp;gt;   Use &amp;lt;directory&amp;gt; as path to apt&amp;#39;s list files instead
                            of /var/state/apt/lists/ or /var/lib/apt/lists/
 -p|--package=&amp;lt;package&amp;gt;     Print versions for &amp;lt;package&amp;gt;.
 -r|--regex                 Read package with -p as regex
 -R|--regex-all             Like --regex, but also show not installed packages.
 -u|--upgradeable           Print only upgradeable packages
 -a|--allversions           Print all available versions.
 -b|--brief                 Short output.
 -nh|--nohold               Don&amp;#39;t treat holded packages.
 -i|--initialize            Initialize or update package cache only (as root).
 -v|--verbose               Verbose messages.
 -h|--help                  Print this help.&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ apt-show-versions ruby1.8
ruby1.8/karmic-updates uptodate 1.8.7.174-1ubuntu1

$ apt-show-versions -a ruby1.8
ruby1.8 1.8.7.174-1ubuntu1 install ok installed
ruby1.8 1.8.7.174-1        karmic         us.archive.ubuntu.com
ruby1.8 1.8.7.174-1ubuntu1 karmic-updates us.archive.ubuntu.com
No stable version
ruby1.8/karmic-updates uptodate 1.8.7.174-1ubuntu1&lt;/code&gt;&lt;/pre&gt;</content>
	</entry>
	<entry>
		<title>Apple Tablet Wishlist</title>
		<author>
			<name>Andrew Carter</name>
		</author>
		<link type="text/html" href="http://ascarter.net/2010/01/10/apple-tablet-wishlist.html" rel="alternate" />
		<published>2010-01-10T21:35:37-08:00</published>
		<updated>2010-01-10T21:35:37-08:00</updated>
		<id>tag:ascarter.net,2010-01-10:/2010/01/10/apple-tablet-wishlist</id>
		<content type="html">&lt;p&gt;All around the tech world, heavy speculation is underway as anticipation grows for the next thing from &lt;a href='http://apple.com'&gt;Apple&lt;/a&gt; at the end of January 2010. CES has come and gone. It seems to me Apple managed to overshadow the whole thing by simply saying they are launching something. Talk about influence.&lt;/p&gt;

&lt;p&gt;So let&amp;#8217;s assume there is a tablet coming. What does that mean? Why is it useful? Why would I want one?&lt;/p&gt;

&lt;p&gt;I have a wishlist for such a device. Today, I use a MacBook Pro 15&amp;#8221;, iPhone 3GS, a Sony Reader, a Sony Playstation 3, a Sony PSPgo, and a Dell Optiplex running Ubuntu Linux. That&amp;#8217;s a lot of devices that do a lot of things. What could the tablet do that all those devices can&amp;#8217;t?&lt;/p&gt;

&lt;h2 id='what_i_want'&gt;What I Want&lt;/h2&gt;

&lt;h5 id='replace_other_devices'&gt;Replace Other Devices&lt;/h5&gt;

&lt;p&gt;To add another device like this, I want it to replace others. In particular, I&amp;#8217;d want the tablet to replace a dedicated ebook reader (my Sony 505 in this case). I&amp;#8217;d also want it to negate anything I&amp;#8217;d want a netbook to do. I had a Dell Mini 9 for a couple months but found it too much of a compromise.&lt;/p&gt;

&lt;h5 id='dont_replace_every_device'&gt;Don&amp;#8217;t Replace Every Device&lt;/h5&gt;

&lt;p&gt;Conversely, I don&amp;#8217;t want it to replace all my other devices. I have so many because they all do something well. The tablet should be no different. It should not aim to replace everything. It won&amp;#8217;t replace my MacBook or my desktop machine. Not my phone either. And probably not my PSP. Unlike most people, I don&amp;#8217;t find the iPhone that good for games and like dedicated game consoles.&lt;/p&gt;

&lt;h5 id='ebooks'&gt;ebooks&lt;/h5&gt;

&lt;p&gt;The biggest reason I would want a tablet is as an ebook reader. I&amp;#8217;ve started to transition away from print this past year. It has now become very rare for me to buy technical books any other way than electronic. I&amp;#8217;m also trying to buy other books as ebooks as well.&lt;/p&gt;

&lt;p&gt;My Sony 505 is a nice piece of hardware. The form factor is much better than the Kindle in my opinion. However, the major problem is not the display or the controls. It&amp;#8217;s the size. It can&amp;#8217;t show a large form technical book like the O&amp;#8217;Reilly or Pragmatic Programmer books I typically buy. It does support PDF but not very well.&lt;/p&gt;

&lt;p&gt;The tablet for me would need a screen size that can easily scale a large format book with minimal loss of fidelity. I would also gladly move my magazine subscriptions to digital as well. I buy 95% of my music digitally. I still buy some Blu-Ray movies but I use Hulu or Netflix much more frequently. It only makes sense for the same reasons to move all my reading to digital.&lt;/p&gt;

&lt;h5 id='ipod_hd'&gt;iPod HD&lt;/h5&gt;

&lt;p&gt;The iPhone has a pretty good iPod embedded. I like it in most cases like commuting or traveling. But at home, I could easily see enjoying a larger format personal media device. My wife and I watch very different content in different ways. She watches shows recorded on our Tivo on a flat screen TV. I watch shows off my MacBook or PS3. A personal device that has high definition video support (and can stream it) would be great. I think online streaming services like Netflix and Hulu are required too.&lt;/p&gt;

&lt;p&gt;The other exciting thing a table could offer is a return to albums for music. I&amp;#8217;m old enough to remember getting vinyl records (then later cassettes and CD&amp;#8217;s) and listening to the whole album while poring over the liner notes and lyrics. The new iTunes albums could flourish on the tablet.&lt;/p&gt;

&lt;h5 id='wifi'&gt;WiFi&lt;/h5&gt;

&lt;p&gt;It goes without saying but the tablet must have full WiFi support. I think 802.11n has to be supported to enable it to stream HD reliably. Besides, Apple already sells a whole line of 802.11n wireless gear.&lt;/p&gt;

&lt;h5 id='extremely_sleek_form_factor'&gt;Extremely Sleek Form Factor&lt;/h5&gt;

&lt;p&gt;Apple are masters at creating amazing hardware designs. I&amp;#8217;m confident the tablet won&amp;#8217;t disappoint here. I think it needs to be about the thickness of the iPhone but much easier to grip and hold. It should follow the trend of the iPhone and have the bare minimum of hard buttons. I think the Kindle DX is a clear example of how &lt;strong&gt;not&lt;/strong&gt; to do it.&lt;/p&gt;

&lt;h5 id='transparent_integration'&gt;Transparent Integration&lt;/h5&gt;

&lt;p&gt;Other than the ebook capabilities, I think enabling the tablet to seamlessly integrate with your other devices is what will set it apart. Some examples would be allowing it to function as an additional screen when you dock it with your MacBook. It should be perfectly sized to act as a status window or document viewer monitor. Other companies already sell dedicated monitors in the size that the tablet is rumored to be. Think about how cool it would be to have your MacBook hooked up to your 24&amp;#8221; Cinema display and the tablet docked next to that. You could put your IM windows or a web page on it. Then when you are ready to leave, just pull the tablet and go.&lt;/p&gt;

&lt;p&gt;Another integration possibility is to be the universal remote for the other entertainment devices in your home media center. Or how about hooking the tablet up via HDMI to your plasma TV and streaming Hulu and Netflix.&lt;/p&gt;

&lt;p&gt;Yet another is for live events. You could be watching a soccer match on ESPN while a synchronized stream of stats and other data could be on the tablet. There are so many possibilities to using a device like this as an extender.&lt;/p&gt;

&lt;h2 id='what_i_dont_want'&gt;What I &lt;strong&gt;Don&amp;#8217;t&lt;/strong&gt; Want&lt;/h2&gt;

&lt;h5 id='cellular_3g'&gt;Cellular 3G&lt;/h5&gt;

&lt;p&gt;I&amp;#8217;ve got an iPhone (and everyone has some sort of mobile phone). The tablet will not fit in my pocket (if it does, it&amp;#8217;s a failure). I would rather see it tether to the iPhone. Or carry a portable 3G WiFi bridge instead.&lt;/p&gt;

&lt;h5 id='keyboardmouse'&gt;Keyboard/Mouse&lt;/h5&gt;

&lt;p&gt;There is absolutely no advantage to the tablet over a slim laptop if you start carrying around a keyboard or mouse. Integrate as an extender and have a touch screen keyboard.&lt;/p&gt;

&lt;h5 id='bigger_iphone'&gt;Bigger iPhone&lt;/h5&gt;

&lt;p&gt;If the tablet is simply a large iPhone or iPod Touch, it&amp;#8217;s doomed. The iPhone works because the UI is designed for the iPhone and only the iPhone. Tablet needs to do the same.&lt;/p&gt;

&lt;h5 id='smaller_mac'&gt;Smaller Mac&lt;/h5&gt;

&lt;p&gt;If the tablet is just a less capable MacBook, it is again doomed. That&amp;#8217;s what Microsoft is building. And it is worthless. You can buy a cheaper netbook or a spend a little more for a real laptop.&lt;/p&gt;

&lt;p&gt;So that&amp;#8217;s my wishlist. No idea how accurate it is but I get excited thinking about this kind of device.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m a lifelong Apple fan. Apple literally defined the personal computer for me. My parents were completely unaware that the Apple IIc they bought for me in 1984 would shape the course of my life. I&amp;#8217;m a programmer today because of that machine. So I do believe that Apple has the power to change everything. I can&amp;#8217;t say for sure that the Apple tablet is going to be that kind of device but I won&amp;#8217;t be the least bit surprised if it is.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Rails Development on Ubuntu 9.10</title>
		<author>
			<name>Andrew Carter</name>
		</author>
		<link type="text/html" href="http://ascarter.net/2010/01/04/rails-development-on-ubuntu-9.10.html" rel="alternate" />
		<published>2010-01-04T23:03:49-08:00</published>
		<updated>2010-01-04T23:03:49-08:00</updated>
		<id>tag:ascarter.net,2010-01-04:/2010/01/04/rails-development-on-ubuntu-9.10</id>
		<content type="html">&lt;p&gt;I use both Mac OS X and Ubuntu Linux for &lt;a href='http://rubyonrails.org'&gt;Ruby on Rails&lt;/a&gt; devleopment. In both cases, setting up an environment is relatively easy but not without some pitfalls. I&amp;#8217;ve been using Rails on Mac OS X since Tiger 10.5 and on Ubuntu since 7.10. I&amp;#8217;ve kept &lt;a href='http://www.backpackit.com'&gt;Backpack pages&lt;/a&gt; with my recipes for how to set it up. This post will explain how to setup Ruby on Rails for &lt;a href='http://ww.ubuntu.com'&gt;Ubuntu 9.10&lt;/a&gt;. It&amp;#8217;s certainly not the only way and it&amp;#8217;s obviously biased by my preferences. But I&amp;#8217;ve used this recipe successfully over several ubuntu releases.&lt;/p&gt;

&lt;p&gt;So with that out of the way, let&amp;#8217;s get Ruby on Rails up on Ubuntu.&lt;/p&gt;

&lt;h1 id='assumptions'&gt;Assumptions&lt;/h1&gt;

&lt;p&gt;The steps are done assuming a new clean install of Ubuntu 9.10. I use 64-bit Alternate typically for my installs but it should be nearly identical both for 32-bit and/or Desktop installs. Also, I&amp;#8217;ll use &lt;code&gt;apt-*&lt;/code&gt; commands. Use synaptic or dpkg if you wish.&lt;/p&gt;

&lt;h1 id='prerequisites'&gt;Pre-requisites&lt;/h1&gt;

&lt;p&gt;By default, you will have minimal development tools available. The first thing to do is install the primary tool chain. This is mostly gcc and common development libraries. In Ubuntu, many packages have a &lt;code&gt;lib*-dev&lt;/code&gt; version that includes headers and the libraries needed for linking. Fortunately, it&amp;#8217;s very easy to get the default gcc installed:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo apt-get install build-essential&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The package &lt;code&gt;build-essential&lt;/code&gt; is a metapackage that includes gcc and all the supporting libraries and tools. It&amp;#8217;s very much like installing Xcode on a Mac. You now will have all the compilers and are ready to build most source that is packaged via autoconf.&lt;/p&gt;

&lt;h1 id='ruby'&gt;Ruby&lt;/h1&gt;

&lt;p&gt;Ubuntu 9.10 includes both Ruby 1.8 and 1.9 in the package system. At this time, Ruby 1.8 is still more widely used for Rails development. Hopefully that will change soon since Ruby 1.9 has many great improvements.&lt;/p&gt;

&lt;p&gt;I generally have used the packaged ruby installs for Ubuntu. There aren&amp;#8217;t many configuration options you would tweak when building ruby so it&amp;#8217;s only a question of the ruby version that would make you want to install from source in my opinion.&lt;/p&gt;

&lt;p&gt;There are a couple other libraries you should install from packages as well. These include native libraries for SSL and zlib. I also install RDoc, RI and irb from packages. You also should install &lt;code&gt;ruby-dev&lt;/code&gt; to be able to compile native ruby gems later.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s the install for the ruby stack:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo apt-get install ruby rdoc ri irb libyaml-ruby libzlib-ruby libopenssl-ruby ruby-dev&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Another optional install is the first edition of the &lt;a href='http://www.ruby-doc.org/docs/ProgrammingRuby/'&gt;Ruby Book&lt;/a&gt;. It might be handy but you do have a &lt;a href='http://www.pragprog.com/titles/ruby3/programming-ruby-1-9'&gt;newer version&lt;/a&gt; than that don&amp;#8217;t you?&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo apt-get install rubybook&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It will be installed to:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/usr/share/doc/rubybook/html/index.html&lt;/code&gt;&lt;/pre&gt;

&lt;h1 id='rubygems'&gt;Rubygems&lt;/h1&gt;

&lt;p&gt;So far, setup has been easy since everything comes from the package system. Now we start to deviate. Rubygems has been a &lt;a href='http://pkg-ruby-extras.alioth.debian.org/rubygems.html'&gt;source of contention&lt;/a&gt; between Debian and the Rubygems developers. The core problem is that both are package systems. Rubygems can (and arguably should) manage all gem packages. On Debian systems, dpkg should own all the packages installed in the system. This could include gems as well. This is where the friction starts.&lt;/p&gt;

&lt;p&gt;No matter which side of the argument you might find yourself, the good news is that installing rubygems from source is easy and it puts it in the system location anyway since that is where Ruby already is installed.&lt;/p&gt;

&lt;p&gt;My rule for gems: &lt;em&gt;Only use apt to install supporting C-libraries to allow native gems to build. Install gems themselves via a source install for rubygems.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For locally built source that I install (i.e. to &lt;code&gt;/usr/local&lt;/code&gt;), I prefer to put the source in &lt;code&gt;/usr/local/src&lt;/code&gt;. But feel free to install anywhere you like.&lt;/p&gt;

&lt;p&gt;To install rubygems, you need to download the latest tarball. As of this writing, it is 1.3.5. Then extract the archive and install:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd /usr/local/src
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar xzvf rubygems-1.3.5.tgz
cd rubygems-1.3.5
sudo ruby setup.rb&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The gem binary is now installed:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/usr/bin/gem1.8&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you want to have &lt;code&gt;gem&lt;/code&gt; point to the 1.8 binary:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo update-alternatives --install /usr/bin/gem gem /usr/bin/gem1.8 1&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next, run a gem system update to be sure you are on the latest version:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo gem update --system&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Rubygems should now be installed and ready to go.&lt;/p&gt;

&lt;h1 id='rails_and_other_gems'&gt;Rails and Other Gems&lt;/h1&gt;

&lt;p&gt;Rubygems installs dependencies automatically. Installing the Rails gem which will bring in ActionPack, ActiveRecord, and other supporting gems. Additionally, you might want to install a few other useful gems for development:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo gem install rails SystemTimer ruby-debug ruby-debug-ide&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id='sqlite'&gt;SQLite&lt;/h3&gt;

&lt;p&gt;SQLite is now the default database a Rails application will use. It is easy to use since the database is kept in a local file and doesn&amp;#8217;t require any server setup. We&amp;#8217;ll setup MySQL later in this recipe so if you need that as well, you&amp;#8217;ll be covered. Note that SQLite is not a good choice if you need to do concurrency development of any kind. SQLite is not a server and sharing the database on multiple instances of your Rails app isn&amp;#8217;t going to go well.&lt;/p&gt;

&lt;p&gt;SQLite is fully supported in the Ubuntu package system. Install the SQLite binaries and libraries, then install the native SQLite gem:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo apt-get install libsqlite3-dev sqlite3 sqlite3-doc
sudo gem install sqlite3-ruby&lt;/code&gt;&lt;/pre&gt;

&lt;h1 id='other_useful_libraries'&gt;Other useful libraries&lt;/h1&gt;

&lt;p&gt;There are some optional libraries that many people use for Rails. Skip either of these if you don&amp;#8217;t need them.&lt;/p&gt;

&lt;h3 id='mysql'&gt;MySQL&lt;/h3&gt;

&lt;p&gt;Unlike on the Mac, &lt;a href='http://mysql.com'&gt;MySQL&lt;/a&gt; is very easy to setup on Ubuntu. For 9.10, MySQL 5.1 is the default:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo apt-get install libmysqlclient-dev mysql-server
sudo gem install mysql&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id='imagemagickrmagick'&gt;ImageMagick/RMagick&lt;/h3&gt;

&lt;p&gt;Again, unlike on the Mac, &lt;a href='http://www.imagemagick.org'&gt;ImageMagick&lt;/a&gt; and &lt;a href='http://rmagick.rubyforge.org/'&gt;RMagick&lt;/a&gt; are very easy to install:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo apt-get install imagemagick libmagickcore-dev
sudo gem install rmagick&lt;/code&gt;&lt;/pre&gt;

&lt;h1 id='final_thoughts'&gt;Final Thoughts&lt;/h1&gt;

&lt;p&gt;One thing that is good to learn is how Ruby interacts with the underlying system as well as how to separate who installs what. Usually, most code is pure ruby and is very easy to install via gems.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ll follow up this post with a recipe for getting &lt;a href='http://www.modrails.com/'&gt;Passenger&lt;/a&gt; up and running on Ubuntu. Passenger is a fantastic way to do Rails development. It is likely going to mirror how you deploy code in production as well. I&amp;#8217;m a big fan of running development as close to production as you can to minimize surprises.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>ClickToFlash for Safari</title>
		<author>
			<name>Andrew Carter</name>
		</author>
		<link type="text/html" href="http://ascarter.net/2010/01/04/clicktoflash-for-safari.html" rel="alternate" />
		<published>2010-01-04T21:54:42-08:00</published>
		<updated>2010-01-04T21:54:42-08:00</updated>
		<id>tag:ascarter.net,2010-01-04:/2010/01/04/clicktoflash-for-safari</id>
		<content type="html">&lt;p&gt;Not sure where I first saw this, but the WebKit plugin &lt;a href='http://rentzsch.github.com/clicktoflash/'&gt;ClickToFlash&lt;/a&gt; is a required for any Safari user. Flash has numerous bad properties. It&amp;#8217;s a resource hog and many sites use it for annoying things like ads that start playing once you navigate to a site. ClickToFlash intercepts all that and gives you a simple button in place of the Flash content. If you do want to view it, click the button.&lt;/p&gt;

&lt;p&gt;There is also a nice whitelist feature you can use to enable entire sites to run Flash without permission. Additionally, it is easy to turn off ClickToFlash if you really need to.&lt;/p&gt;

&lt;p&gt;Rumor is that this was originally written by someone in Adobe but no idea if that is true. &lt;a href='http://rentzsch.com'&gt;Jonathan &amp;#8216;Wolf&amp;#8217; Rentzsch&lt;/a&gt; is the current maintainer of it now. Code is available on &lt;a href='http://github.com/rentzsch/clicktoflash'&gt;GitHub&lt;/a&gt;. And it&amp;#8217;s not an InputManager hack so it looks like a real solution.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Gem Server launchd Agent</title>
		<author>
			<name>Andrew Carter</name>
		</author>
		<link type="text/html" href="http://ascarter.net/2010/01/01/gem-server-launchd-agent.html" rel="alternate" />
		<published>2010-01-01T14:05:00-08:00</published>
		<updated>2010-01-01T14:05:00-08:00</updated>
		<id>tag:ascarter.net,2010-01-01:/2010/01/01/gem-server-launchd-agent</id>
		<content type="html">&lt;p&gt;&lt;a href='http://rubyforge.org/projects/rubygems/'&gt;Ruby Gems&lt;/a&gt; provides an &lt;a href='http://rdoc.sourceforge.net'&gt;RDoc&lt;/a&gt; server for the installed gems on a system. It is trivial to get it up and running. In your console, use the following command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gem server&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A local http server will now be running on port 8808 that serves all the installed RDoc documentation for your gems. It&amp;#8217;s a great way to look at the exact documentation that matches the code your have installed.&lt;/p&gt;

&lt;p&gt;Starting with Mac OS X 10.4, managing daemons and other services has been performed by &lt;a href='http://developer.apple.com/macosx/launchd.html'&gt;launchd&lt;/a&gt;. It&amp;#8217;s an elegant and modern replacement for traditional startup systems like init and rc. But it wasn&amp;#8217;t entirely obvious to me how to create my own custom startup script.&lt;/p&gt;

&lt;p&gt;There are two places you could chose to setup your daemon. One is at the system level for any user on the machine. Another is in your local user account. If you put it at the system level (in &lt;em&gt;/Library/LaunchAgents&lt;/em&gt;), you will have the server up and running anytime the machine boots up. If you use your user account, it will launch on login.&lt;/p&gt;

&lt;p&gt;On my MacBook Pro laptop, I chose to use a launch agent for my account. On a shared machine or server, you might want to use the system level approach.&lt;/p&gt;

&lt;p&gt;To define a launch agent, create a file for the launchd definition called:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;~/Library/LaunchAgents/org.rubyforge.rubygems.server.plist&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then, use the following code to define a launchd agent that will startup the gem server instance:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='xml'&gt;&lt;span class='cp'&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;/span&gt;
&lt;span class='cp'&gt;&amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot;&lt;/span&gt;
&lt;span class='cp'&gt; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;/span&gt;
&lt;span class='nt'&gt;&amp;lt;plist&lt;/span&gt; &lt;span class='na'&gt;version=&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span class='nt'&gt;&amp;gt;&lt;/span&gt;
&lt;span class='nt'&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;
	&lt;span class='nt'&gt;&amp;lt;key&amp;gt;&lt;/span&gt;Label&lt;span class='nt'&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
	&lt;span class='nt'&gt;&amp;lt;string&amp;gt;&lt;/span&gt;org.rubyforge.rubygems.server&lt;span class='nt'&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
	&lt;span class='nt'&gt;&amp;lt;key&amp;gt;&lt;/span&gt;ProgramArguments&lt;span class='nt'&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
	&lt;span class='nt'&gt;&amp;lt;array&amp;gt;&lt;/span&gt;
		&lt;span class='nt'&gt;&amp;lt;string&amp;gt;&lt;/span&gt;/usr/bin/gem&lt;span class='nt'&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
		&lt;span class='nt'&gt;&amp;lt;string&amp;gt;&lt;/span&gt;server&lt;span class='nt'&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
		&lt;span class='nt'&gt;&amp;lt;string&amp;gt;&lt;/span&gt;--daemon&lt;span class='nt'&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
	&lt;span class='nt'&gt;&amp;lt;/array&amp;gt;&lt;/span&gt;
	&lt;span class='nt'&gt;&amp;lt;key&amp;gt;&lt;/span&gt;RunAtLoad&lt;span class='nt'&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
	&lt;span class='nt'&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;
	&lt;span class='nt'&gt;&amp;lt;key&amp;gt;&lt;/span&gt;KeepAlive&lt;span class='nt'&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
	&lt;span class='nt'&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;
&lt;span class='nt'&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;
&lt;span class='nt'&gt;&amp;lt;/plist&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;You can either log out then log back in or load and start it from the command line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;launchctl load ~/Library/LaunchAgents/org.rubyforge.rubygems.server.plist
launchctl start org.rubyforge.rubygems.server	&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Enter the following in your browser:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;http://localhost:8808/&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;From now on when you login, you will have a running gem server with local copies of the documentation for all versions of the gems installed on your machine.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Reboot</title>
		<author>
			<name>Andrew Carter</name>
		</author>
		<link type="text/html" href="http://ascarter.net/2009/12/31/reboot.html" rel="alternate" />
		<published>2009-12-31T22:05:00-08:00</published>
		<updated>2009-12-31T22:05:00-08:00</updated>
		<id>tag:ascarter.net,2009-12-31:/2009/12/31/reboot</id>
		<content type="html">&lt;p&gt;It&amp;#8217;s been a long time coming but I&amp;#8217;ve finally done a reboot of my web site. The old blog is gone. Some of the content might find its way back in here but probably not.&lt;/p&gt;

&lt;p&gt;I plan to write about what I know - software, Rails in particular.&lt;/p&gt;

&lt;p&gt;I have a long list of posts that I&amp;#8217;ve wanted to write for some time. I used the excuse of the website redesign to put it off. With that out of the way, I&amp;#8217;ll begin to publish those regularly over the next few weeks.&lt;/p&gt;

&lt;p&gt;I have a couple notes on building this site. I&amp;#8217;ll expand on this much more later but it is built using &lt;a href='http://github.com/mojombo/jekyll'&gt;Jekyll&lt;/a&gt;. This is an excellent static site generation tool written in Ruby. When you think about it, this is the way personal web publishing should be done. I don&amp;#8217;t need a complicated web application for the relatively few pages I want to publish.&lt;/p&gt;

&lt;p&gt;Jekyll is a breath of fresh air compared with bloated software like &lt;a href='http://wordpress.org'&gt;Wordpress&lt;/a&gt;. The Jekyll project wiki has everything you need to get started. Or read &lt;a href='http://blog.martiandesigns.com/'&gt;Adam&amp;#8217;s post&lt;/a&gt; on how he built his site using Jekyll. I&amp;#8217;ll be putting the source for this website up on my &lt;a href='http://github.com/ascarter'&gt;GitHub&lt;/a&gt; account in the next few days.&lt;/p&gt;</content>
	</entry>
</feed>