<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Brilliant Corners</title>
    <link>http://brilliantcorners.org/</link>
    <language>en-us</language>
    <webMaster>billturner@gmail.com (Bill Turner)</webMaster>
    <pubDate>2011-02-16T16:57:12-05:00</pubDate>
    <ttl>60</ttl>
    <description>The weblog of Pittsburgh-based Ruby on Rails developer Bill Turner</description>
    
      <item>
        <title>Building Vim on OSX Snow Leopard</title>
        <link>http://brilliantcorners.org/2011/02/building-vim-on-osx-snow-leopard</link>
        <pubDate>2011-02-15T21:28:00-05:00</pubDate>
        <guid>http://brilliantcorners.org/2011/02/building-vim-on-osx-snow-leopard</guid>
        <description>
          <![CDATA[
            <p>Although I haven't abandoned <a href="http://macromates.com/" title="The TextMate homepage">TextMate</a> as my editor of choice for day-to-day coding, I have been taking the time to really learn <a href="http://www.vim.org/" title="The Vim homepage">Vim</a> and all it can do. I've used Vim for 10+ years, but with only the most basic of commands for editing files on remote servers, or quick changes to various config files. As I learn more, I'm finding that Vim can do just about everything I'm used to in TextMate, and in some cases, more.</p>

<p>I've been using <a href="http://code.google.com/p/macvim/" title="The MacVim homepage">MacVim</a> for learning, which is a full-featured, native app for OSX. It has built in support for everything you want to do or add on: 256 colors, Ruby support, etc. But if you're in Terminal.app and fire up <code>vim</code>, you'll find that some of your (<em>my</em>) favorite plugins that work fine in MacVim, do not work (specifically: <a href="https://wincent.com/products/command-t" title="The Command-T homepage">Command-T</a> needs Ruby support, and <a href="http://code.google.com/p/conque/" title="The ConqueTerm homepage">ConqueTerm</a> needs Python support). The default Vim install in OSX lacks a lot of the niceties that come by default with MacVim. Here's how I built a new version of Vim for using in Terminal.app.</p>

<p>The Vim download page suggests using <a href="http://mercurial.selenic.com/" title="The Mercurial homepage">Mercurial</a> to fetch the latest version of the source if you want to compile it yourself. <a href="http://mercurial.selenic.com/wiki/Download#Mac_OS_X" title="Three options for installing Mercurial on OSX">Here are some options for installing Mercurial on OSX</a>. Once that's done, you'll want to find a place to fetch the source. I put mine in <code>~/tmp/</code>.</p>

<pre><code># fetch the source into a vim directory
hg clone https://vim.googlecode.com/hg/ vim

cd vim

# make sure you're up to date
hg pull
hg update
</code></pre>

<p>Now that you have the latest version of the source, it's time to compile your own version of Vim:</p>

<pre><code># configure to install in /usr/local/bin and make sure Ruby and Python
# support are built in
./configure --prefix=/usr/local --enable-rubyinterp --enable-pythoninterp --with-features=huge

# build
make

# after it's finished building, you can double check that the support you 
# want is now built in with this command:
./src/vim --version
</code></pre>

<p>In the output from that command, you should see <code>+ruby</code> and <code>+python</code> which signifies that both Ruby and Python support are built in, and that's what I needed. Since the newly built Vim is what we want, install it:</p>

<pre><code>make install
</code></pre>

<p>In order to make sure that <em>this</em> Vim is used when typing <code>vim</code> at the command line, make sure that <code>/usr/local/bin</code> comes first in your path. This way our full-featured Vim at <code>/usr/local/bin/vim</code> will be called instead of the OSX built-in version at <code>/usr/bin/vim</code>. For reference, this is how I set path in my <code>~/.bashrc</code>:</p>

<pre><code>export PATH="/usr/local/bin:/usr/local/pgsql/bin:/usr/local/php5/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
</code></pre>

<p>And now you have a version of Vim that should allow you to add on just about any plugin available. But, if you want to take advantage of themes with 256 colors, you won't be able to do that in Terminal.app, but a replacement like <a href="http://code.google.com/p/iterm2/" title="The iTerm2 homepage">iTerm2</a> would work just fine.</p>

<p>If you ever need to recompile a newer version, or just to try some different configuration options, you'll need to clean up the build directories and update the source beforehand:</p>

<pre><code># thoroughly clean the source tree
make clean
make distclean

# update vim source
hg pull
hg update default
</code></pre>

<p>Then you can proceed with the configuration and build steps above.</p>

<hr />

<p>References:</p>

<ul>
<li><a href="http://www.vim.org/mercurial.php">http://www.vim.org/mercurial.php</a></li>
<li><a href="https://wincent.com/wiki/Installing_Vim_7.3_beta_on_Mac_OS_X_10.6.4_Snow_Leopard">https://wincent.com/wiki/Installing_Vim_7.3_beta_on_Mac_OS_X_10.6.4_Snow_Leopard</a></li>
<li><a href="http://mercurial.selenic.com/wiki/Download#Mac_OS_X">http://mercurial.selenic.com/wiki/Download#Mac_OS_X</a></li>
</ul>


          ]]>
        </description>
        
          
            <category><![CDATA[osx]]></category>
          
            <category><![CDATA[vim]]></category>
          
        
      </item>
    
      <item>
        <title>A better way to install MongoDB on Ubuntu</title>
        <link>http://brilliantcorners.org/2010/12/a-better-way-to-install-mongodb</link>
        <pubDate>2010-12-14T18:10:00-05:00</pubDate>
        <guid>http://brilliantcorners.org/2010/12/a-better-way-to-install-mongodb</guid>
        <description>
          <![CDATA[
            <p>My <a href="http://brilliantcorners.org/2010/01/installing-mongodb-on-ubuntu/" title="My previous MongoDB on Ubuntu archive post">last post on installing MongoDB on Ubuntu</a> is quite popular. Sadly, they aren't the best, or the most up to date installation instructions. While I don't really mess with MongoDB anymore, I feel a little bad with so much traffic coming from Google to those outdated instructions. In fact, it's super easy to install MongoDB on an Ubuntu server these days.</p>

<p>Basically, all you need to do is add a new source to your <code>/etc/apt/sources.list</code>. For the latest Ubuntu (10.10 at the time of this post), you'll add:</p>

<pre><code>deb http://downloads.mongodb.org/distros/ubuntu 10.10 10gen
</code></pre>

<p>Once you've added the new source, you'll need to import MongoDB's public GPG key in order to download from the official servers:</p>

<pre><code>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
</code></pre>

<p>Once that's done, run <code>sudo apt-get update</code> and then <code>sudo apt-get install mongodb-stable</code> to get the latest stable release. Once installed, you can configure via the configuration file at <code>/etc/mongodb.conf</code>.</p>

<p>The full instructions, including the source URLs for older Ubuntu/Debian versions, can be found on <a href="http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages" title="Ubuntu and Debian package instructions on the MongoDB website">the MongoDB website</a>.</p>

<p><em>Edited 12/15/2010: Added the GPG key step.</em></p>

          ]]>
        </description>
        
          
            <category><![CDATA[mongodb]]></category>
          
            <category><![CDATA[ubuntu]]></category>
          
        
      </item>
    
      <item>
        <title>Simple bash aliases for Jekyll</title>
        <link>http://brilliantcorners.org/2010/09/simple-bash-aliases-for-jekyll</link>
        <pubDate>2010-09-20T23:01:00-04:00</pubDate>
        <guid>http://brilliantcorners.org/2010/09/simple-bash-aliases-for-jekyll</guid>
        <description>
          <![CDATA[
            <p>As I get a little more comfortable with how <a href="http://github.com/mojombo/jekyll" title="The Jekyll weblog software">Jekyll</a> works, I've found a few Bash aliases that have been helping out. Below are four aliases I have set up to make blogging with Jekyll easier (with a little explanation for each).</p>

<pre><code># let's write an entry (cd to path and open up TextMate)
alias timetoblog="cd ~/code/blog &amp;&amp; mate ."

# start up Jekyll for local preview of blog
alias serveblog="cd ~/code/blog &amp;&amp; jekyll --server --auto"

# delete the existing built site and rebuild
alias buildblog="cd ~/code/blog &amp;&amp; rm -rf _site/ &amp;&amp; jekyll"

# use rsync to push the weblog to my host
alias deployblog="cd ~/code/blog &amp;&amp; rsync -rtz --delete _site/ username@host.com:~/path/to/weblog/root/"
</code></pre>

<p>Each of these assume a little on how you have Jekyll configured, so you will have to adjust each for your own setup. You can see <a href="http://github.com/billturner/brilliantcorners.org/blob/master/_config.yml" title="Link to my own Jekyll configuration file.">my own configuration options on Github</a>.</p>

<p>Some of these tips originally came from the <a href="http://wiki.github.com/mojombo/jekyll" title="Jekyll wiki">Jekyll wiki</a> and various <a href="http://asymmetrical-view.com/2009/05/14/starting-wtih-jekyll.html" title="Weblog post on getting started with Jekyll">weblog</a> <a href="http://alexyoung.org/2009/07/09/new-blog/" title="Another weblog post on using Jekyll">posts</a>.</p>

          ]]>
        </description>
        
          
            <category><![CDATA[jekyll]]></category>
          
            <category><![CDATA[bash]]></category>
          
        
      </item>
    
      <item>
        <title>Trying out Jekyll</title>
        <link>http://brilliantcorners.org/2010/09/trying-out-jekyll</link>
        <pubDate>2010-09-09T00:30:00-04:00</pubDate>
        <guid>http://brilliantcorners.org/2010/09/trying-out-jekyll</guid>
        <description>
          <![CDATA[
            <p>I'll keep this short: I've yet again relaunched the weblog using yet other kind of weblog software. There are several not-so-well thought out reasons for changing everything again, but the main ones are:</p>

<ol>
<li>Since I didn't write this software, I won't be <em>too</em> tempted to rewrite it</li>
<li>I have other ideas I'd rather be working on instead of rewriting weblog software (which I seem to have a problem with)</li>
<li><a href="http://github.com/mojombo/jekyll" title="The Jekyll weblog software on Github">Jekyll</a> generates static files, which should lessen the load on my VPS</li>
</ol>


<p>This one should hold me over for long enough. At least long enough to write another post.</p>

          ]]>
        </description>
        
          
            <category><![CDATA[ruby]]></category>
          
            <category><![CDATA[github]]></category>
          
            <category><![CDATA[jekyll]]></category>
          
            <category><![CDATA[site news]]></category>
          
        
      </item>
    
      <item>
        <title>Updated my s3 backup script to support MongoDB</title>
        <link>http://brilliantcorners.org/2010/02/updated-s3-backup-script</link>
        <pubDate>2010-02-11T13:34:03-05:00</pubDate>
        <guid>http://brilliantcorners.org/2010/02/updated-s3-backup-script</guid>
        <description>
          <![CDATA[
            <p>Given <a href="http://brilliantcorners.org/2010/01/installing-mongodb-on-ubuntu" title="My recent post on installing MongoDB">my recent interest</a> in <a href="http://mongodb.org/" title="The MongoDB home page">MongoDB</a>, I figured I should update <a href="http://brilliantcorners.org/2009/12/a-simple-ruby-script-for-backing-up-files-to-amazon-s3" title="My previous entry on the simple-s3-backup.rb script">my Ruby backup script</a> to now support the exporting and backing up of MongoDB databases.</p>

<p>I've updated the code and placed the changes up in <a href="http://github.com/billturner/" title="My main Github account page">my Github account</a>: <a href="http://github.com/billturner/simple-s3-backup" title="A direct link to the 'simple-s3-backup' repository on Github">simple-s3-backup</a>.</p>

          ]]>
        </description>
        
          
            <category><![CDATA[mongodb]]></category>
          
            <category><![CDATA[ruby]]></category>
          
            <category><![CDATA[system administration]]></category>
          
        
      </item>
    
      <item>
        <title>Installing MongoDB on Ubuntu</title>
        <link>http://brilliantcorners.org/2010/01/installing-mongodb-on-ubuntu</link>
        <pubDate>2010-01-31T20:34:51-05:00</pubDate>
        <guid>http://brilliantcorners.org/2010/01/installing-mongodb-on-ubuntu</guid>
        <description>
          <![CDATA[
            <p><strong>EDIT: Please take a look at <a href="http://brilliantcorners.org/2010/12/a-better-way-to-install-mongodb" title="A new post on installing MongoDB on Ubuntu">some updated instructions</a>. The information here is a bit out of date, and makes things a <em>lot</em> harder than it needs to be.</strong></p>

<p>There are already a few installation tutorials for getting <a href="http://www.mongodb.org/" title="The MongoDB home page">MongoDB</a> up and running on an Ubuntu server, but each either left a step or two out, or their suggested setup wasn't what I was looking for, so I'm sharing my own tips. But, a few notes first:</p>

<ol>
<li>These instructions are how I installed MongoDB on Ubuntu 8.10 (Intrepid Ibex)</li>
<li>Many of the tutorials out there recommend putting MongoDB in <code>/opt/mongodb</code>, but I chose <code>/usr/local</code> instead</li>
<li>These instructions worked for me, and they probably will for you, but I can't guarantee a thing</li>
</ol>


<p><strong>Initial user and directory setup</strong></p>

<p>Before installing anything, I'm going to prepare some necessary directories and create the mongodb user:</p>

<pre><code>sudo adduser mongodb
# for the mongodb data files:
sudo mkdir /var/lib/mongodb
# for the log files:
sudo mkdir /var/log/mongodb
sudo chown mongodb /var/lib/mongodb/
</code></pre>

<p><strong>Install dependencies</strong></p>

<p>Install the needed dependencies for building MongoDB from source:</p>

<pre><code>sudo apt-get install curl tcsh scons g++ xulrunner-1.9-dev libpcre++-dev libboost-dev libmozjs-dev
</code></pre>

<p>Now, the Mozilla JavaScript libary. I normally install from my own temp directory (<code>~/tmp</code>), but download and compile from wherever you're comfortable:</p>

<pre><code>curl -O ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz
tar zxvf js-1.7.0.tar.gz
cd js/src
export CFLAGS="-DJS_C_STRINGS_ARE_UTF8"
make -f Makefile.ref
sudo JS_DIST=/usr make -f Makefile.ref export
</code></pre>

<p><strong>Build MongoDB</strong></p>

<p>We'll use <code>git</code> to clone the source from <a href="http://github.com/mongodb/mongo" title="The MongoDB source tree at GitHub.com">their GitHub repository</a>. I'm also going to compile the 1.2.2 release instead of the current HEAD. Again, get the source and build from whichever temp directory you're comfortable with.</p>

<pre><code>git clone git://github.com/mongodb/mongo.git
cd mongo
# checkout the 1.2.2 release for building
git checkout -b build r1.2.2
# build:
scons all
# install:
sudo scons --prefix=/usr/local install
</code></pre>

<p>Now, create the <code>init.d</code> script file to have MongoDB start up on a reboot.</p>

<pre><code>sudo vi /etc/init.d/MongoDB
# my version of this script is here: http://gist.github.com/291349
# make init script executable:
sudo chmod +x /etc/init.d/MongoDB
# set up runtime links:
sudo update-rc.d MongoDB defaults
</code></pre>

<p>And to get it up and running, just run the init script:</p>

<pre><code>sudo /etc/init.d/MongoDB start
</code></pre>

<p>If all the steps above went without any problems, then MongoDB should now be up and running on your Ubuntu server.</p>

<p>Here are some references that helped a lot in getting my own setup working:</p>

<ul>
<li><a href="http://tech.favoritemedium.com/2009/08/installing-mongodb-on-ubuntu-904-jaunty.html" title="This tutorial came the closest to getting me where I wanted">Installing MongoDB on Ubuntu 9.04 Jaunty Jackalope</a></li>
<li><a href="http://www.mongodb.org/display/DOCS/Building+for+Linux" title="This also helped, but missed alot">MongoDB docs: Building for Linux</a></li>
</ul>


<p>Now, what I'm <em>using</em> MongoDB for will have to wait a day or so. :)</p>

          ]]>
        </description>
        
          
            <category><![CDATA[mongodb]]></category>
          
            <category><![CDATA[ubuntu]]></category>
          
        
      </item>
    
      <item>
        <title>A simple Ruby script for backing up files to Amazon S3</title>
        <link>http://brilliantcorners.org/2009/12/simple-ruby-script-to-backup-to-s3</link>
        <pubDate>2009-12-14T21:22:20-05:00</pubDate>
        <guid>http://brilliantcorners.org/2009/12/simple-ruby-script-to-backup-to-s3</guid>
        <description>
          <![CDATA[
            <p>After reading about <a href="http://news.ycombinator.com/item?id=990323" title="Hacker News post on Jeff Atwood's 100% data loss">the troubles Jeff Atwood had with his host going down</a>, I figured it was time I get a real backup process in place for my own data. Since my hosting is self-managed (at <a href="http://slicehost.com/" title="Slicehost's web site">Slicehost</a>) without any sort of attached official backup plan, I'm definitely vulnerable to any sort of server failure. I've had a near miss a couple of times with personal computers--which I now back up often--but I've yet to set up anything recurring for my hosted files.</p>

<p>So, I took some time over the weekend and wrote a simple backup script with Ruby that saves the archive files to <a href="http://aws.amazon.com/s3/" title="Amazon S3 information page">Amazon S3</a>. A while back I tried something similar using <a href="http://en.wikipedia.org/wiki/Rsync" title="Wikipedia entry for 'rsync'">rsync</a>, but at the time I stumbled on setting the SSH keys and all that up. Since I'm now using S3 to host images for <a href="http://thetoolsartistsuse.com/" title="The Tools Artists Use weblog">The Tools Artists Use</a>, adding another "bucket" to store some backups was a no-brainer.</p>

<p>The script works for me, and since it may be useful for others, I've put the code up on <a href="http://github.com/billturner/" title="My main Github account page">my Github account</a>: <a href="http://github.com/billturner/simple-s3-backup" title="A direct link to the 'simple-s3-backup' repository on Github">simple-s3-backup</a>.</p>

          ]]>
        </description>
        
          
            <category><![CDATA[ruby]]></category>
          
            <category><![CDATA[system administration]]></category>
          
        
      </item>
    
      <item>
        <title>Weblog bankruptcy</title>
        <link>http://brilliantcorners.org/2009/11/weblog-bankruptcy</link>
        <pubDate>2009-11-25T01:14:05-05:00</pubDate>
        <guid>http://brilliantcorners.org/2009/11/weblog-bankruptcy</guid>
        <description>
          <![CDATA[
            <p>Well, I did it. I killed the old weblog.</p>

<p>I didn't just change weblog software (although I did do that, too), but I'm getting rid of all the old posts. Half of them are outdated and the rest were sort of useless. It want to start somewhat fresh again.</p>

<p>In a few days, I'll have something a little more substantive on the big switch. Until then, welcome to the new brilliantcorners.org!</p>

          ]]>
        </description>
        
          
            <category><![CDATA[site news]]></category>
          
        
      </item>
    
  </channel>
</rss>

