<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Benjamin Atkin &#187; configuration</title>
	<atom:link href="http://benatkin.com/tag/configuration/feed/" rel="self" type="application/rss+xml" />
	<link>http://benatkin.com</link>
	<description></description>
	<lastBuildDate>Sun, 29 Jan 2012 03:51:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Rails 3.1 and Xeround MySQL on Heroku</title>
		<link>http://benatkin.com/2011/10/13/rails-3-1-and-xeround-mysql-on-heroku/</link>
		<comments>http://benatkin.com/2011/10/13/rails-3-1-and-xeround-mysql-on-heroku/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 05:31:45 +0000</pubDate>
		<dc:creator>Ben Atkin</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[heroku]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://benatkin.com/?p=979</guid>
		<description><![CDATA[I&#8217;m developing a Rails site that uses MySQL and runs on Heroku. I&#8217;m using Xeround for the database, which has a free trial. Xeround is a database PaaS (Platform as a Service) that runs on several places, including Amazon Web &#8230; <a href="http://benatkin.com/2011/10/13/rails-3-1-and-xeround-mysql-on-heroku/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m developing a Rails site that uses MySQL and runs on Heroku. I&#8217;m using <a href="http://xeround.com/">Xeround</a> for the database, which has a free trial. Xeround is a database PaaS (Platform as a Service) that runs on several places, including Amazon Web Services in their U. S. East region, which is where Heroku runs. Running it in the same place where Heroku runs gives it a low latency.</p>
<p>To set up Xeround, sign up for an account and set up a database instance in the AWS U. S. East region. Go to the page for the database instance, and you will see the username and the database URLs.</p>
<p>Rails reads its database configuration from <code>config/database.yml</code>. Heroku overwrites <code>config/database.yml</code> with a file it generates from the <code>DATABASE_URL</code> configuration variable. The configuration variable uses the database driver name as the network scheme (e. g. <code>mysql://</code>). There is more than one mysql driver for Rails; the one suggested in the Rails Guide is <code>mysql2</code>.</p>
<p>To use mysql2 as the database driver with Xeround, use the following for the <code>DATABASE_URL</code> configuration variable:</p>
<div class="highlight-wrapper ">
<div class="tools">
<div class="wrap">
<a href="#" class="show-raw">raw</a><a href="#" class="show-colored">highlighted</a><a href="#" class="to-clipboard">copy</a><a href="#" class="print">print</a><a href="#" class="about">?</a>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<pre class="raw"><code>heroku config:add DATABASE_URL='mysql2://{{username}}:{{password}}@{{hostname}}:{{port}}/{{dbname}}'</code></pre>
<div class="highlighted">
<table class="highlighttable">
<tr>
<td class="linenos">
<div class="linenodiv">
<pre class="nl">1</pre>
</div>
</td>
<td class="code">
<div class="highlight">
<pre><span class="x">heroku config:add DATABASE_URL='mysql2://</span><span class="cp">{{</span><span class="nv">username</span><span class="cp">}}</span><span class="x">:</span><span class="cp">{{</span><span class="nv">password</span><span class="cp">}}</span><span class="x">@</span><span class="cp">{{</span><span class="nv">hostname</span><span class="cp">}}</span><span class="x">:</span><span class="cp">{{</span><span class="nv">port</span><span class="cp">}}</span><span class="x">/</span><span class="cp">{{</span><span class="nv">dbname</span><span class="cp">}}</span><span class="x">'</span>
</pre>
</div>
</td>
</tr>
</table>
</div>
</div>
<p>The username, hostname, and port number can be seen on the DB Instance Manager page on Xeround. The hostname and port are under one of the three <em>DNS Names</em>; I picked the top one. The password is what was entered for the database password during signup. The database name is the name of the database to be added using <a href="http://www.phpmyadmin.net/home_page/index.php">PHPMyAdmin</a>.</p>
<p>The driver also needs to be included in the <code>Gemfile</code>. To include it just for production, use:</p>
<pre class="brush: ruby; title: ; notranslate">
group :production do
  gem 'mysql2'
end
</pre>
<p>After adding this, run <code>bundle install</code>, commit your changes, and push to Heroku.</p>
<p>The database still needs to be created. To create the database, click on one of the links under <em>DNS Names</em> on the DB Instance Manager. This brings up PHPMyAdmin. Enter the database password and log in. Then create the database, with the same name used for the <code>DATABASE_URL</code> configuration variable.</p>
<p>Now that the database has been created, the DATABASE_URL is set, and the Gemfile is updated and pushed, you should be able to migrate the database by running <code>heroku run rake db:migrate</code>.</p>
<p>I&#8217;m using the latest version of Rails (3.1.1) on Heroku&#8217;s cedar stack.</p>
<p>It will be interesting to see how well Xeround works for this project. There are other MySQL hosting options for EC2 if I need them, and migrating is fairly simple.</p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/2011/10/13/rails-3-1-and-xeround-mysql-on-heroku/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>setting up a default virtualenv</title>
		<link>http://benatkin.com/2009/12/09/setting-up-a-default-virtualenv/</link>
		<comments>http://benatkin.com/2009/12/09/setting-up-a-default-virtualenv/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 01:11:47 +0000</pubDate>
		<dc:creator>Ben Atkin</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://benatkin.com/weblog/?p=464</guid>
		<description><![CDATA[After using virtualenv for months, I finally got around to putting my main virtualenv into my bash profile. It&#8217;s really simple. All I had to do was add the following to ~/.bash_profile: # python virtualenv source /Users/ben/virtualenv/pearl/bin/activate This worked, but &#8230; <a href="http://benatkin.com/2009/12/09/setting-up-a-default-virtualenv/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After using <a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a> for months, I finally got around to putting my main virtualenv into my bash profile. It&#8217;s really simple. All I had to do was add the following to ~/.bash_profile:</p>
<p><code># python virtualenv<br />
source /Users/ben/virtualenv/pearl/bin/activate</code></p>
<p>This worked, but there was one thing I wanted to turn off. The <em>activate</em> script that virtualenv creates adds the name of the current virtualenv to the front of the prompt. This is useful when switching between virtualenv directories, but it&#8217;s not very useful to me when I&#8217;m on the default virtualenv. So I moved my prompt definition to the bottom of the file, so it gets executed after the <em>source</em> command above.</p>
<p><code># prompt (moved after virtualenv so it isn't shown)<br />
PS1="\[\e[31;40m\]\@ \[\e[32;40m\]\w \[\e[36;40m\]\$\[\e[0m\] "</code></p>
<p>By the way, to keep the prompt I use the most often short, I set my own colors. It&#8217;s easy for me to tell that it&#8217;s my main shell, and since it&#8217;s my main shell, I know the username and hostname associated with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/2009/12/09/setting-up-a-default-virtualenv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

