<?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>Doug Clark</title>
	<atom:link href="http://dougclarkonline.com/feed" rel="self" type="application/rss+xml" />
	<link>http://dougclarkonline.com</link>
	<description>rails. php. whatever.</description>
	<lastBuildDate>Thu, 26 Jan 2012 06:29:37 +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>Stop SOPA Now!</title>
		<link>http://dougclarkonline.com/archives/335</link>
		<comments>http://dougclarkonline.com/archives/335#comments</comments>
		<pubDate>Tue, 17 Jan 2012 17:08:00 +0000</pubDate>
		<dc:creator>dougc84</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://dougclarkonline.com/archives/335</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://dougclarkonline.com/archives/335/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>carrierwave_securefile 0.2.0 out!</title>
		<link>http://dougclarkonline.com/archives/325</link>
		<comments>http://dougclarkonline.com/archives/325#comments</comments>
		<pubDate>Mon, 05 Dec 2011 21:39:00 +0000</pubDate>
		<dc:creator>dougc84</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[blowfish]]></category>
		<category><![CDATA[carrierwave]]></category>
		<category><![CDATA[carrierwave_securefile]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[gost]]></category>
		<category><![CDATA[rijndael]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[securefile]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://dougclarkonline.com/?p=325</guid>
		<description><![CDATA[Hey all, carrierwave_securefile 0.1 was&#8230; buggy, to say the least. Realistically, it only worked on one of my own projects. So, today, I released 0.2.0, which now gives you the option to select a different encryption algorithm (defaults to Blowfish, but you can select Rijndael and GOST as well &#8211; please read the article linked [...]]]></description>
			<content:encoded><![CDATA[<p>Hey all,</p>
<p>carrierwave_securefile 0.1 was&#8230; buggy, to say the least. Realistically, it only worked on one of my own projects.</p>
<p>So, today, I released 0.2.0, which now gives you the option to select a different encryption algorithm (defaults to Blowfish, but you can select Rijndael and GOST as well &#8211; please read the article linked below before changing the algorithm), as well as changing the download code syntax slightly.</p>
<p>Read through the usage <a title="GitHub" href="https://github.com/dougc84/carrierwave_securefile/wiki/Usage">here</a>, and check out this small article on encryption types <a title="GitHub" href="https://github.com/dougc84/carrierwave_securefile/wiki/v0.2-Encryption-Types-and-A-Bit-About-Encryption">here</a>.</p>
<p>As always, if you notice a bug or any problems, don&#8217;t hesitate to let me know. Thanks!</p>
<p><a title="GitHub" href="https://github.com/dougc84/carrierwave_securefile">GitHub Project Page For carrierwave_securefile Gem</a></p>
<p><a title="RubyGems" href="https://rubygems.org/gems/carrierwave_securefile">RubyGems Page</a></p>
<div class="woo-sc-box alert   full"><strong>Update:</strong> Looks like 0.2.x is just as buggy as 0.1.x, at least when it comes to using a :file store. I&#8217;m working on it.</div>
]]></content:encoded>
			<wfw:commentRss>http://dougclarkonline.com/archives/325/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CarrierWave_SecureFile</title>
		<link>http://dougclarkonline.com/archives/320</link>
		<comments>http://dougclarkonline.com/archives/320#comments</comments>
		<pubDate>Mon, 28 Nov 2011 07:14:16 +0000</pubDate>
		<dc:creator>dougc84</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[carrierwave]]></category>
		<category><![CDATA[carrierwave_securefile]]></category>
		<category><![CDATA[securefile]]></category>

		<guid isPermaLink="false">http://dougclarkonline.com/?p=320</guid>
		<description><![CDATA[I just released 0.1.0 of CarrierWave_SecureFile &#8211; a gem for Rails to encrypt and decrypt file uploads and downloads using a Blowfish cypher. Requires Ruby 1.9, Rails 3.1 (though it should work on any version of Rails 3). Check it out on RubyGems.org. Click the homepage link for the Git repo. Enjoy!]]></description>
			<content:encoded><![CDATA[<p>I just released 0.1.0 of CarrierWave_SecureFile &#8211; a gem for Rails to encrypt and decrypt file uploads and downloads using a Blowfish cypher.  Requires Ruby 1.9, Rails 3.1 (though it should work on any version of Rails 3).</p>
<p>Check it out <a href="https://rubygems.org/gems/carrierwave_securefile" title="CarrierWave_SecureFile" target="_blank">on RubyGems.org</a>.  Click the homepage link for the Git repo.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://dougclarkonline.com/archives/320/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing mysql2 gem using MAMP and RVM</title>
		<link>http://dougclarkonline.com/archives/304</link>
		<comments>http://dougclarkonline.com/archives/304#comments</comments>
		<pubDate>Mon, 21 Nov 2011 08:12:38 +0000</pubDate>
		<dc:creator>dougc84</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[3.1]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[mamp]]></category>
		<category><![CDATA[mysql2]]></category>
		<category><![CDATA[rvm]]></category>

		<guid isPermaLink="false">http://dougclarkonline.com/?p=304</guid>
		<description><![CDATA[Because I work with different platforms (PHP, Ruby, WordPress, etc.), it&#8217;s always been easier for me to maintain a database setup using MAMP, rather than the built-in options Mac OS X has. However, this leads to some issues when setting up a database in a Ruby on Rails environment. Rails makes connecting to a database [...]]]></description>
			<content:encoded><![CDATA[<p>Because I work with different platforms (PHP, Ruby, WordPress, etc.), it&#8217;s always been easier for me to maintain a database setup using MAMP, rather than the built-in options Mac OS X has.</p>
<p>However, this leads to some issues when setting up a database in a Ruby on Rails environment. Rails makes connecting to a database easy &#8211; if you have a standard configuration, or, even better, if you&#8217;re using sqlite. Nearly every production environment I&#8217;ve used uses MySQL or PostgreSQL, and deployment is a breeze (:crosses fingers:).</p>
<p>I came across this need a while back, and spent nearly a day (!!!) trying to make this happen.  Today I needed to upgrade a project to Rails 3.1, which requires mysql2 >0.3.  I was using 0.2.  Bollocks.  Back to the drawing board.<br />
<span id="more-304"></span></p>
<p>Most guides out there make you install a custom version of MAMP (which, in part, you need to do), tell you &#8220;no, don&#8217;t do that, don&#8217;t you know OS X has MySQL built in, n00b?,&#8221; or some other bits of ridiculous information that don&#8217;t actually&#8230; you know&#8230; help. And while I can&#8217;t say this is this solve-all for installing the mysql2 gem, it&#8217;s what has worked for me, and hopefully it will help for you as well.</p>
<p>Before continuing, I&#8217;m assuming you&#8217;re running at least Rails 3.0, preferably 3.1, as the asset pipeline is magical.  My setup is MAMP 1.9.5 (I know, 2.0 is out, but 1.9.5 works fine for what I need), and my code folder is set up in /Developer/code/.  I set up MAMP to use default ports (80 for Apache, 3306 for MySQL).  I&#8217;m also running Ruby 1.9.3 (which is much faster than 1.9.2, and seemingly more stable).</p>
<p>You should also have OS X Developer Tools installed, which you can grab <a href="http://developer.apple.com" title="Apple Developer Portal" target="_blank">here</a>.  You should also have RVM installed, which you can grab <a href="http://beginrescueend.com/" title="RVM" target="_blank">here</a>.  I had issues running the CURL command to download and install RVM, but I found an alternate method.  That isn&#8217;t being covered here &#8211; there&#8217;s guides out there on how to install RVM.</p>
<p>Also, tons of thanks to <a href="http://blog.mirotin.net/35/mamp-1-9-5-mysql-5-5-9-and-ruby-mysql2" title="this post" target="_blank">this post</a> for all of the steps to make this happen.  I just found it hard to read and work through in my situation, and I thought I would try to rewrite it to save some time, as well as adding a few additional steps I needed to take.</p>
<p>If you&#8217;re starting from scratch, run the</p>
<pre>rails new MyNewAwesomeSpectacularProject</pre>
<p>command, but don&#8217;t specify an ORM.  This will create a new project using sqlite.  If you&#8217;re currently using sqlite, you can obviously skip this step.</p>
<p>If you haven&#8217;t installed MAMP yet, you&#8217;ll need to grab a copy <a href="http://sourceforge.net/projects/mamp/files/mamp/" title="here" target="_blank">here</a>.  Download both the normal DMG, as well as the components DMG (basically the source).  If you already have MAMP, open it up, click the MAMP menu, and hit about to find out what version you&#8217;re using, and grab the corresponding components DMG.  I really wouldn&#8217;t recommend using anything prior to 1.9.</p>
<p>You&#8217;ll also need <a href="http://www.macports.org/install.php" title="MacPorts" target="_blank">MacPorts</a>.  If you don&#8217;t know if you have it or not, fire up Terminal, type <code>port</code> and an interactive shell should come up.  Just type exit to get out.  If it gives a &#8220;command not found&#8221; error, go ahead and install MacPorts.  It makes life easier.</p>
<p>Install MAMP if you haven&#8217;t yet (duh).</p>
<p>So now you should have MAMP and MacPorts up and running, and a DMG of MAMP components.  No?  RTFM (read: see above and follow the steps, silly).</p>
<p>Open the components DMG, and grab the mysql tarball (something like mysql-5.5.9.tar.gz) to your desktop (or wherever, just change the following paths accordingly).</p>
<p>Now, we need to get dirty in the Terminal.  Fire it up, and copy the tarball to your /tmp folder (it really is easier this way).</p>
<pre>mv ~/Desktop/mysql-5.5.9.tar.gz .</pre>
<p>Untar:</p>
<pre>tar xf mysql-5.5.9.tar.gz</pre>
<p>And lets move into the mysql source directory:</p>
<pre>cd mysql-5.5.9</pre>
<p>If you have already installed MacPorts, the next command may be unnecessary.  Try typing</p>
<pre>cmake</pre>
<p>in Terminal.  If it gives you some info, skip this.  If not, go ahead and run the following:</p>
<pre>sudo port install cmake</pre>
<p><code>cmake</code> is basically a cross-platform version of the <code>make</code> command, which this package requires to create an installation designed for your system.</p>
<p>Now let&#8217;s do some crazy stuff.  Let&#8217;s make an install based on what&#8217;s already installed.</p>
<pre>cmake . -DMYSQL_UNIX_ADDR=/Applications/MAMP/tmp/mysql/mysql.sock -DCMAKE_INSTALL_PREFIX=/Applications/MAMP/Library
make -j 3</pre>
<p>Basically, the purpose of this is to generate a few files we need to interact with the mysql2 gem, which are not included in the normal install.  Let&#8217;s copy these files over to where they can be easily accessed and aren&#8217;t hanging out in your tmp folder:</p>
<pre>cp libmysql/*.dylib /Applications/MAMP/Library/lib/
mkdir -p /Applications/MAMP/Library/include/mysql
cp include/* /Applications/MAMP/Library/include/mysql</pre>
<p>Alrighty!  Now we&#8217;re ready to install mysql2.  Head on over to your app folder, and make sure the gemset you want to use is selected.  I recommend using a separate gemset for each app you work on just to keep things clean.  Also, the new version of Bundler (1.1) removes unused gems for you &#8211; you don&#8217;t want to upgrade one app just to screw up 10 others, do you?  Yeah, just create a gemset.</p>
<pre>cd /path/to/my/app
rvm use 1.9.3
rvm gemset create myappgemset
rvm use 1.9.3@myappgemset
echo "rvm use 1.9.3@myappgemset" > .rvmrc</pre>
<p>That last line creates an .rvmrc file in your app root, which will automagically execute every time you cd to your app.  Really freaking neat.  You don&#8217;t have to remember all of your gemsets anymore.</p>
<p>Now, the time you&#8217;ve been waiting for.  Let&#8217;s install mysql2!</p>
<pre>env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config</pre>
<p>There should be no issues installing now &#8211; hurray!  Basically, you&#8217;re telling the RubyGems package manager to install mysql2 using the 64-bit architecture of OS X 10.6 and 10.7, and to use the configuration for MAMP instead of the configuration for the system MySQL.</p>
<p>BUT!!!  We&#8217;re not done yet.  A few more steps, and we&#8217;ll be out of the water faster than I could write this post.</p>
<pre>sudo install_name_tool -change /tmp/mysql-5.5.9/libmysql/libmysqlclient.16.dylib /Applications/MAMP/Library/lib/libmysqlclient.16.dylib ~/.rvm/gems/<b>[ruby-1.9.3-p0@myappgemset]</b>/gems/<b>[mysql2-0.3.10]</b>/lib/mysql2/mysql2.bundle</pre>
<p>Just change your appropriate gemset and mysql2 gem version (mysql2-0.3.10 is the most recent as of this writing) where bracketed and bold.</p>
<p>Great!  Your gem is working.  We just need a couple more steps.  Let&#8217;s remove the mysql files from /tmp:</p>
<pre>rm -rf /tmp/mysql-5.5.9 /tmp/mysql-5.5.9.tar.gz</pre>
<p>Add the following line to your <code>Gemfile</code> (again, assuming 0.3.10, as of this writing):</p>
<pre>gem 'mysql2', '0.3.10'</pre>
<p>Save it, and run <code>bundle</code> on your app (fun tip: you don&#8217;t ever need to type <code>bundle install</code> &#8211; just typing <code>bundle</code> does the same thing.  Ah, saving keystrokes.</p>
<p>And, finally, let&#8217;s set up your database.yml file:</p>
<pre>development:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: <b>[yourapp]</b>_development
  pool: 5
  username: <b>[MAMP Username]</b>
  password: <b>[MAMP Password]</b>
  host: localhost
  socket: /Applications/MAMP/tmp/mysql/mysql.sock</pre>
<p>The main difference here in the <code>socket</code> line, which tells mysql to connect to your MySQL socket file, instead of the system socket file.</p>
<p>Now, fire it up and get going!  Again, I can&#8217;t promise this will fix all problems, but it&#8217;s worked for me.</p>
<p>If you&#8217;re updating the gem only, and you&#8217;ve done the previous steps in the past, you can simply start at the <code>gem install mysql2</code> line.  Just be sure to remove your old mysql2 gem first &#8211; it&#8217;s easier to uninstall and reinstall than it is to update.</p>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://dougclarkonline.com/archives/304/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Need A New Web Site?</title>
		<link>http://dougclarkonline.com/archives/291</link>
		<comments>http://dougclarkonline.com/archives/291#comments</comments>
		<pubDate>Mon, 31 Oct 2011 19:41:53 +0000</pubDate>
		<dc:creator>dougc84</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://dougclarkonline.com/?p=291</guid>
		<description><![CDATA[&#8230; and need it done fast?  Contact me today, or find out some more details from the latest Craigslist ad: http://richmond.craigslist.org/crs/2678400275.html Ciao!]]></description>
			<content:encoded><![CDATA[<p>&#8230; and need it done fast?  Contact me today, or find out some more details from the latest Craigslist ad:</p>
<p><a href="http://richmond.craigslist.org/crs/2678400275.html" target="_blank">http://richmond.craigslist.<wbr>org/crs/2678400275.html</wbr></a></p>
<p>Ciao!</p>
]]></content:encoded>
			<wfw:commentRss>http://dougclarkonline.com/archives/291/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails Best Practices</title>
		<link>http://dougclarkonline.com/archives/256</link>
		<comments>http://dougclarkonline.com/archives/256#comments</comments>
		<pubDate>Sat, 22 Oct 2011 05:27:10 +0000</pubDate>
		<dc:creator>dougc84</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.dougclarkonline.com/?p=256</guid>
		<description><![CDATA[Thinking about doing this course soon. I just need some free time&#8230; Has anyone else done this? Thoughts?]]></description>
			<content:encoded><![CDATA[<p>Thinking about doing <a title="Rails Best Practices" href="http://www.codeschool.com/courses/rails-best-practices" target="_blank">this course</a> soon. I just need some free time&#8230;</p>
<p>Has anyone else done this? Thoughts?</p>
]]></content:encoded>
			<wfw:commentRss>http://dougclarkonline.com/archives/256/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Excellent</title>
		<link>http://dougclarkonline.com/archives/200</link>
		<comments>http://dougclarkonline.com/archives/200#comments</comments>
		<pubDate>Fri, 21 Oct 2011 22:35:36 +0000</pubDate>
		<dc:creator>dougc84</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[excellent]]></category>
		<category><![CDATA[steve jobs]]></category>

		<guid isPermaLink="false">http://localhost/dougclarkonline.com/?p=200</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://dougclarkonline.com/archives/200/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

