<?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>Hank Beaver &#187; ruby</title>
	<atom:link href="http://www.hankbeaver.com/index.php/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hankbeaver.com</link>
	<description>Ruby, open-source, Internet technologist located in Atlanta, GA, USA</description>
	<lastBuildDate>Tue, 29 Jun 2010 05:34:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Varnish cache purge Rake task</title>
		<link>http://www.hankbeaver.com/index.php/2009/07/15/varnish-cache-purge-rake-task/</link>
		<comments>http://www.hankbeaver.com/index.php/2009/07/15/varnish-cache-purge-rake-task/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 02:28:24 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[varnish]]></category>
		<category><![CDATA[purge]]></category>
		<category><![CDATA[rake]]></category>
		<category><![CDATA[task]]></category>

		<guid isPermaLink="false">http://www.rubyslacker.com/?p=93</guid>
		<description><![CDATA[This example uses Ruby to telnet into Varnish and issue the &#8220;url.purge .*&#8221; command. The only gotcha is that the varnish telnet server does not issue a command prompt which causes Ruby telnet to timeout and get cranky. Well a little exception handling hacks past this. Enjoy.

require 'rubygems'

namespace "varnish" do

  desc "Purge ALL urls [...]]]></description>
			<content:encoded><![CDATA[<p>This example uses Ruby to telnet into Varnish and issue the &#8220;url.purge .*&#8221; command. The only gotcha is that the varnish telnet server does not issue a command prompt which causes Ruby telnet to timeout and get cranky. Well a little exception handling hacks past this. Enjoy.</p>
<pre>
require 'rubygems'

namespace "varnish" do

  desc "Purge ALL urls from Varnish"
  task :global_purge => :environment do

    #It WILL timeout, just accept it. Varnish does not have a command prompt.
    require 'net/telnet'
    @result = ""
    begin
      localhost = Net::Telnet::new("Host" => "localhost",
      "Port" => 6082,
      "Timeout" => 5)
      localhost.cmd("url.purge .*") { |c| @result = c}
    rescue Exception
      if @result.include? ("200 0")
        puts "varnish purged OK."
      else
        raise "Varnish not purged."
      end
    end
  end

end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2009/07/15/varnish-cache-purge-rake-task/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging/Troubleshooting Rails Applications in Production Enviroments</title>
		<link>http://www.hankbeaver.com/index.php/2009/05/29/debuggingtroubleshooting-rails-applications-in-production-enviroments/</link>
		<comments>http://www.hankbeaver.com/index.php/2009/05/29/debuggingtroubleshooting-rails-applications-in-production-enviroments/#comments</comments>
		<pubDate>Fri, 29 May 2009 22:55:37 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[production]]></category>

		<guid isPermaLink="false">http://www.rubyslacker.com/?p=84</guid>
		<description><![CDATA[Introduction
At my current gig with Primedia, we have some pretty high volume Rails sites. Since having highly available sites are essential for our core business, we have to be very attentive to production issues. Below is a list that I&#8217;ve compiled recently in my head and by working with some very bright folks. This doc [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>At my current gig with <a href="http://www.primedia.com">Primedia</a>, we have some pretty high volume Rails sites. Since having highly available sites are essential for our core business, we have to be very attentive to production issues. Below is a list that I&#8217;ve compiled recently in my head and by working with some very bright folks. This doc is to help Ops/Dev remember some basics and tricks when debugging issues. So remember to try this stuff.</p>
<p><strong>Non-Technical (READ FIRST)</strong></p>
<p>1. If the issue is not a major impact on production, make sure all your troubleshooting is passive! You might introduce an outage if you try serious troubleshooting.<br />
2. Confirm the issue with Ops/Infrastructure in your presence, this gets buy-in from with the folks who have official root access.<br />
3. As a developer, you should not work alone on production systems except to gather information (if you get temporary access). All changes (in seeking issue mitigation) should be paired with Ops/Infra. This will avoid finger-pointing and headaches later.</p>
<p><strong>Technical</strong></p>
<p>Elimination + log files is my troubleshooting method of choice.</p>
<p>1. Skip the load balancer if possible and hit direct IP/Port of a single app server to eliminate load balancer in mix.<br />
2. Enable DEBUG log level and restart app server(s). Preferably, take an app server out of load balancer pool and work on in isolation. Regardless, DEBUG can slow response signficantly so be aware. However, there are situations where DEBUG is the only way to get an indication from Rails what is going on.<br />
3. Tail log file of single app IP/Port to squelch noise from other servers and hit just that app server.<br />
4. Make sure that the PIDs are not hung,old versions. Look at time/date of PIDS. If the deploy is screwed up, you can be deploying new code and yet the processes running are code from a month ago.<br />
5. To be thorough, look at the kernel logs too. In Linux, /var/log/messages etc. You could have something else that is going on.<br />
6. The logs should give status regarding database(s), but especially look for the words &#8220;timeout&#8221; if you have any custom network libraries that fetch data (we do) or &#8220;ActiveRecord&#8221;.  Perhaps even, grep for it.<br />
7. Use a non-browser client, like Curl or wget to eliminate possible browser issues. Case in point, we had an issue related to ActiveRecord sessions that were migrated to another datacenter. When accessed via Curl there was no issue (Curl does not save cookies by default).</p>
<p><strong>Other</strong></p>
<p>1. If you cannot duplicate issue in development, remember to change your configs to look like production mode and run your development workstation in production mode. Rails behaves different in its modes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2009/05/29/debuggingtroubleshooting-rails-applications-in-production-enviroments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby CMS List</title>
		<link>http://www.hankbeaver.com/index.php/2008/12/04/ruby-cms-list/</link>
		<comments>http://www.hankbeaver.com/index.php/2008/12/04/ruby-cms-list/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 13:43:15 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.rubyslacker.com/?p=62</guid>
		<description><![CDATA[Motivation: 
As an avid Ruby/Rails programmer and longtime CMS coder and user the following is yet another effort to keep a list of current Ruby/Rails CMS&#8217;s. That is the goal of this post. I will use comments from others to update the list and hopefully keep and up-to-date list for all (including myself) to use. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Motivation: </strong><br />
As an avid Ruby/Rails programmer and longtime CMS coder and user the following is yet another effort to keep a list of current Ruby/Rails CMS&#8217;s. That is the goal of this post. I will use comments from others to update the list and hopefully keep and up-to-date list for all (including myself) to use. Heck, I would love to have others help review and keep list up to date.</p>
<p><strong>External Resources:</strong></p>
<p>http://www.widgetfinger.com/<br />
http://www.ajaxlines.com/ajax/stuff/article/top_ruby_cms.php</p>
<p>http://webscripts.softpedia.com/downloadTag/ruby+cms</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2008/12/04/ruby-cms-list/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using ruby to move subversion folders and files.</title>
		<link>http://www.hankbeaver.com/index.php/2008/09/18/using-ruby-to-move-subversion-folders-and-files/</link>
		<comments>http://www.hankbeaver.com/index.php/2008/09/18/using-ruby-to-move-subversion-folders-and-files/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 13:15:36 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://1000fires.com/wordpress/?p=45</guid>
		<description><![CDATA[I want to move all files in this svn dir:
svn list http://svn.atld1/svn-prodops/sysadmin
to:
svn list http://svn.atld1/svn-prodops/sysadmin/scripts
Doing svn mv would see obvious and using xargs or -exec might work. I prefer not to use any brain energy on a shell script. I just do it in ruby in 5 minutes:
svn list http://svn.atld1/svn-prodops/sysadmin &#62; /tmp/script.list
Write this to a ruby [...]]]></description>
			<content:encoded><![CDATA[<p>I want to move all files in this svn dir:</p>
<pre>svn list http://svn.atld1/svn-prodops/sysadmin</pre>
<p>to:</p>
<pre>svn list http://svn.atld1/svn-prodops/sysadmin/scripts</pre>
<p>Doing svn mv would see obvious and using xargs or -exec might work. I prefer not to use any brain energy on a shell script. I just do it in ruby in 5 minutes:</p>
<pre>svn list http://svn.atld1/svn-prodops/sysadmin &gt; /tmp/script.list</pre>
<p>Write this to a ruby file:</p>
<pre>f = File.open("/tmp/script.list")</pre>
<pre>f.each_line {|line|</pre>
<pre>cmd = "svn mv http://svn.atld1/svn-prodops/sysadmin/#{line.strip}
http://svn.atld1/svn-prodops/sysadmin/scripts/ -m
\"moving #{line} to scripts \" "</pre>
<pre>puts "running: #{cmd}"
`#{cmd}"</pre>
<pre>}</pre>
<p>Now execute the file above after double checking. Viola done even with relevant comments for each move!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2008/09/18/using-ruby-to-move-subversion-folders-and-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calling initialize in ActiveRecord model causes nil.has_keys? error.</title>
		<link>http://www.hankbeaver.com/index.php/2008/09/02/calling-initialize-in-activerecord-model-causes-nilhas_keys-error/</link>
		<comments>http://www.hankbeaver.com/index.php/2008/09/02/calling-initialize-in-activerecord-model-causes-nilhas_keys-error/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 13:24:35 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[has_keys?]]></category>
		<category><![CDATA[model]]></category>

		<guid isPermaLink="false">http://1000fires.com/wordpress/?p=43</guid>
		<description><![CDATA[When instantiating a model class this error occurs:
instance = MyModel.new
NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.has_key?
This is rectified by placing a super within model class.
def initialize
super
logger.debug("initialize VirtualMta: #{self.class}")
end
]]></description>
			<content:encoded><![CDATA[<p>When instantiating a model class this error occurs:</p>
<pre>instance = MyModel.new</pre>
<pre>NoMethodError: You have a nil object when you didn't expect it!</pre>
<pre>The error occurred while evaluating nil.has_key?</pre>
<p>This is rectified by placing a <strong>super</strong> within model class.</p>
<pre>def initialize</pre>
<pre>super</pre>
<pre>logger.debug("initialize VirtualMta: #{self.class}")</pre>
<pre>end</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2008/09/02/calling-initialize-in-activerecord-model-causes-nilhas_keys-error/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mixin Module Madness &#8212; why self ain&#8217;t really self</title>
		<link>http://www.hankbeaver.com/index.php/2008/04/01/mixin-module-madness-why-self-aint-really-self/</link>
		<comments>http://www.hankbeaver.com/index.php/2008/04/01/mixin-module-madness-why-self-aint-really-self/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 20:11:15 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[self Rails introspection meta]]></category>

		<guid isPermaLink="false">http://1000fires.com/wordpress/?p=39</guid>
		<description><![CDATA[This all came up b/c I wanted to write a shared mixin module to have attachment_fu ready actions for all my controllers that have attachments. No need to put that crap in every controller. So in a mixin module when you want to do some fun reflection/introspection like so:
&#8230;
    @this_obj = self.controller_name.classify.constantize.find_safe
(id,logged_in_user.id)
&#8230;
In [...]]]></description>
			<content:encoded><![CDATA[<p>This all came up b/c I wanted to write a shared mixin module to have attachment_fu ready actions for all my controllers that have attachments. No need to put that crap in every controller. So in a mixin module when you want to do some fun reflection/introspection like so:</p>
<p>&#8230;</p>
<pre>    @this_obj = self.controller_name.classify.constantize.find_safe
(id,logged_in_user.id)</pre>
<p>&#8230;</p>
<p>In Dev this worked great. Tests were good, my mostly view/template developer partner, approved. Deploy to test and WHAMMO!</p>
<p>&#8230;</p>
<pre>    "NameError ("Blogs | ListAll" is not a valid constant name!):</pre>
<p>&#8230;&#8221;</p>
<p>What gives? Mmm, seems when you include a mixin, that is included in a controller. The self.controller_name will report incorrectly in Test and Prod. So I had to adjust the code a little using a new method:</p>
<pre>        @this_obj = self.this_controller_name.classify.constantize.find_safe(
id,logged_in_user.id)</pre>
<p>Below is the method(which is basically David&#8217;s code for controller_name).</p>
<pre>###############################</pre>
<pre>#This method is here b/c it is apparent that Rails
#ActionController.controller_name</pre>
<pre># is unreliable in Test and Production for some reason.</pre>
<pre># attachment_symbol_name: Blogs | List_all_attachments</pre>
<pre># attachment_model ERROR: "Blogs | ListAllAttachment"
#is not a valid constant name</pre>
<pre>###############################</pre>
<pre>def this_controller_name</pre>
<pre>    self_class = self.class.to_s.sub(/Controller$/, '').underscore</pre>
<pre>end</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2008/04/01/mixin-module-madness-why-self-aint-really-self/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>has_many associations, using in helper tag and a little about blocks.</title>
		<link>http://www.hankbeaver.com/index.php/2008/02/10/has_many-associations-using-in-helper-tag-and-a-little-about-blocks/</link>
		<comments>http://www.hankbeaver.com/index.php/2008/02/10/has_many-associations-using-in-helper-tag-and-a-little-about-blocks/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 20:47:43 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[helper]]></category>
		<category><![CDATA[helper tags]]></category>

		<guid isPermaLink="false">http://1000fires.com/wordpress/?p=31</guid>
		<description><![CDATA[Soon the rest of this blog will deal with a basic overview of has_many associations and a practical use. For now look at this simple tag that uses has_many of a Blog model to show the Interests (or topics) for a given blog. You would use this helper_tag like so in your view, given that [...]]]></description>
			<content:encoded><![CDATA[<p>Soon the rest of this blog will deal with a basic overview of has_many associations and a practical use. For now look at this simple tag that uses has_many of a Blog model to show the Interests (or topics) for a given blog. You would use this helper_tag like so in your view, given that you have a single instance of a blog object called ‘blog’</p>
<p><%= more_ugly_interests_tag(blog) %></p>
<p>I hope this small article might help others:</p>
<pre>
#########################################
#Tag to show usage of has_many for a model.
#Ruby on Rails
#*this_model* is the actual instance of a blog or photo
#which has a list of interests.
#
#Call tag like this:
# <%= more_ugly_interests_tag(blog) %>
#the syntax below uses what Ruby calls a 'block'
#this is the format:
# some_variable_that_has_a_list.each { |list_item
# #do something with each item
# puts list_item + " !!!!"
# }
#########################################
def more_ugly_interests_tag(this_model)

to_return = "INTERESTS"

this_model.interests.each { |each_interest|

to_return =  << each_interest << "
"

}

#now we have end the whole function/method with what we want to return/print
to_return

end</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2008/02/10/has_many-associations-using-in-helper-tag-and-a-little-about-blocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding/Developing Rails troubleshooting 101</title>
		<link>http://www.hankbeaver.com/index.php/2008/01/29/codingdeveloping-rails-troubleshooting-101/</link>
		<comments>http://www.hankbeaver.com/index.php/2008/01/29/codingdeveloping-rails-troubleshooting-101/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 18:19:58 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[101]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://1000fires.com/wordpress/?p=28</guid>
		<description><![CDATA[All the Agile folks would say if you run/create your tests you might not even get this far. However, that&#8217;s not always reality for me.
1. &#8216;tail -f /development.log&#8217;
If you are on OSX, the above is easy.
On Windows, I&#8217;d suggest looking at Cygwin and getting tail working. It&#8217;s worth it.
a) open terminal.
b) Clear the screen before [...]]]></description>
			<content:encoded><![CDATA[<p>All the Agile folks would say if you run/create your tests you might not even get this far. However, that&#8217;s not always reality for me.</p>
<p>1. &#8216;tail -f /development.log&#8217;</p>
<p>If you are on OSX, the above is easy.<br />
On Windows, I&#8217;d suggest looking at Cygwin and getting tail working. It&#8217;s worth it.</p>
<p>a) open terminal.<br />
b) Clear the screen before you reattempt what is broken. (Use Apple + K on OSX)<br />
c) Stop tail right after getting the error (CTRL + C)<br />
d) Look for the first line that is not normal Rails and debug output. See next area.</p>
<p>2. Skip all the fluff and go for Ruby errors. You will learn to see &#8220;stacktraces&#8221; and errors in Ruby/Rails after a little practice.</p>
<p>They will look something akin to this:</p>
<p>1)An error<br />
2)The file that the error occurred in&#8230;<br />
3)the line number/and problem code&#8230;<br />
4)A sample of the code at and around the error.<br />
&#8230;<br />
5) A bunch of code that was run prior to this happening.</p>
<p>3. Did you recently change the file in question? If so, revert what you did?</p>
<p>4. Use logger.debug to print out something right before the error to see if your code is making it that far.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2008/01/29/codingdeveloping-rails-troubleshooting-101/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building &amp; Install RMagick on OS X, lessons learned</title>
		<link>http://www.hankbeaver.com/index.php/2007/12/18/building-install-rmagick-on-os-x-lessons-learned/</link>
		<comments>http://www.hankbeaver.com/index.php/2007/12/18/building-install-rmagick-on-os-x-lessons-learned/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 20:01:55 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[RMagick]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://1000fires.com/wordpress/?p=25</guid>
		<description><![CDATA[There are several ways out there to install RMagick: via ports, package installer, etc. My advice: before you even start working on these.
1. Install ALL updates from Apple for your OSX.
2. Update XCode to the latest downloadable version.
Doing the above will save you a whole weekend and avoid weird errors like this:
.libs/libMagick.dylib must have a [...]]]></description>
			<content:encoded><![CDATA[<p>There are several ways out there to install RMagick: via ports, package installer, etc. My advice: before you even start working on these.</p>
<p>1. Install ALL updates from Apple for your OSX.</p>
<p>2. Update XCode to the latest downloadable version.</p>
<p>Doing the above will save you a whole weekend and avoid weird errors like this:<br />
.libs/libMagick.dylib must have a &#8216;:&#8217; between its file names<br />
H</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2007/12/18/building-install-rmagick-on-os-x-lessons-learned/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Extension for GRC&#8217;s Perfect Paper Passwords V3</title>
		<link>http://www.hankbeaver.com/index.php/2007/12/10/ruby-extension-for-grcs-perfect-paper-passwords/</link>
		<comments>http://www.hankbeaver.com/index.php/2007/12/10/ruby-extension-for-grcs-perfect-paper-passwords/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 20:25:48 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://1000fires.com/wordpress/?p=23</guid>
		<description><![CDATA[This is DEPRECATED, because Gavin Stark wrote a native ruby class last month. I will leave this up if someone wants a C implementation for OSX, but after that Gavin did the work in Ruby and I encourage looking there:
 http://hasmanyquestions.wordpress.com/2007/11/23/perfect-paper-passwords-in-ruby/
Ruby Extension for GRC’s Perfect Paper Passwords V3.
UPDATE 12/11/2007, current version only supports Mac OSX, I [...]]]></description>
			<content:encoded><![CDATA[<p>This is DEPRECATED, because Gavin Stark wrote a native ruby class last month. I will leave this up if someone wants a C implementation for OSX, but after that Gavin did the work in Ruby and I encourage looking there:</p>
<p><a title="http://hasmanyquestions.wordpress.com/2007/11/23/perfect-paper-passwords-in-ruby/" href="http://hasmanyquestions.wordpress.com/2007/11/23/perfect-paper-passwords-in-ruby/"> http://hasmanyquestions.wordpress.com/2007/11/23/perfect-paper-passwords-in-ruby/</a></p>
<p>Ruby Extension for GRC’s Perfect Paper Passwords V3.<br />
UPDATE 12/11/2007, current version only supports Mac OSX, I will be creating a Linux version shortly. Not sure if I&#8217;ll wrap a Windows version.<br />
Ruby Extension for GRC’s Perfect Paper Passwords/PPP C (<a title="http://www.grc.com/ppp/" href="http://www.grc.com/ppp/">http://www.grc.com/ppp/</a>) implementation by John Graham-Cumming.<br />
Create with SWIG.<br />
Version .01<br />
CODE/LIB: <a title="ppp3-Ruby-extension.zip" href="http://www.1000fires.com/ppp3-Ruby-extension.zip">http://www.1000fires.com/ppp3-Ruby-extension.zip</a><br />
C Ref: <a title="http://www.jgc.org/blog/2007/11/steve-gibsons-ppp-new-version-3-in-java.html" href="http://www.jgc.org/blog/2007/11/steve-gibsons-ppp-new-version-3-in-java.html">http://www.jgc.org/blog/2007/11/steve-gibsons-ppp-new-version-3-in-java.html</a><br />
NOTE: Because of the way C works, the first argument must be a space (not a null char).</p>
<p>Entry point to ppp3 is “Ppp3.main” Ruby call after include with a Ruby array as argument.</p>
<p>USAGE in ruby:</p>
<blockquote><p>require ‘ppp3&#8242; #ppp3.bundle#Usage 1, just get a random sequence key.<br />
Ppp3.main([” “,” “])</p>
<p># Usage 2, create an array and call with arguments.<br />
# call the Ppp3.main call with this array:</p>
<p>a = Array[”",”efbda242bd1db23fd343b516a2a10d0eed08250e542a789811307f2011a92df6″,”0″,”2″]<br />
Ppp3.main(a)</p>
<p>#Usage 3, call with implied array string.<br />
Ppp3.main([”",”efbda242bd1db23fd343b516a2a10d0eed08250e542a789811307f2011a92df6″,”0″,”70″])</p></blockquote>
<p>TODO. Add a Ruby convenience library to do some parsing and pretty printing as well as prepare for Rails integration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2007/12/10/ruby-extension-for-grcs-perfect-paper-passwords/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
