<?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>Yan Pritzker &#187; software</title>
	<atom:link href="http://yanpritzker.com/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://yanpritzker.com</link>
	<description>photographer, entrepreneur, software engineer, musician, skier</description>
	<lastBuildDate>Thu, 26 Apr 2012 18:11:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<atom:link rel="next" href="http://yanpritzker.com/category/software/feed/?page=2" />

		<item>
		<title>Noobkit: a better way to get your Rails API docs</title>
		<link>http://yanpritzker.com/2007/08/14/noobkit-a-better-way-to-get-your-rails-api-docs/</link>
		<comments>http://yanpritzker.com/2007/08/14/noobkit-a-better-way-to-get-your-rails-api-docs/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 23:49:55 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://skwpspace.com/2007/08/14/noobkit-a-better-way-to-get-your-rails-api-docs/</guid>
		<description><![CDATA[Recently launched Noobkit is a great new way to get at your Rails API docs. The visual design is pleasing and it&#8217;s got an OpenID login system and ability to make bookmarks. It covers the Rails API and many common gems. The look is much more pleasing than the similar gotapi.com which covers more programming [...]]]></description>
			<content:encoded><![CDATA[<p>Recently launched <a href="http://noobkit.com">Noobkit</a> is a great new way to get at your Rails API docs. The visual design is pleasing and it&#8217;s got an OpenID login system and ability to make bookmarks. It covers the Rails API and many common gems. The look is much more pleasing than the similar gotapi.com which covers more programming libraries but is ugly and doesn&#8217;t have any way to bookmark things.</p>
<p>What would be a fun next step here is to build a social system on top of this once more people are using it and show most commonly bookmarked pages, or &#8216;people who bookmarked this gem also bookmarked&#8230;&#8217;. </p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2007/08/14/noobkit-a-better-way-to-get-your-rails-api-docs/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2007/08/14/noobkit-a-better-way-to-get-your-rails-api-docs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Helio Ocean Tips &amp; Tricks</title>
		<link>http://yanpritzker.com/2007/06/28/helio-ocean-tips-tricks/</link>
		<comments>http://yanpritzker.com/2007/06/28/helio-ocean-tips-tricks/#comments</comments>
		<pubDate>Thu, 28 Jun 2007 19:09:16 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[helio ocean]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://skwpspace.com/2007/06/28/helio-ocean-tips-tricks/</guid>
		<description><![CDATA[Strange but true: hold down your &#8216;backspace&#8217; (the one below the flame) and it will turn on your flash/flashlight! The USB cable included actually charges the phone. Plug it in, then exit the media sync mode and you can use your phone while it&#8217;s charging. The indicator will go green when it&#8217;s on full charge. [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li>Strange but true: hold down your &#8216;backspace&#8217; (the one below the flame) and it will turn on your flash/flashlight!</li>
<li>The USB cable included actually charges the phone. Plug it in, then exit the media sync mode and you can use your phone while it&#8217;s charging. The indicator will go green when it&#8217;s on full charge.</li>
<li>To send a text message hold the Down on the directional pad for a second or two (this will bypass the normal inbox screen)</li>
<li>To get directly to your music hold Left for a second or two (this will bypass the normal music screen). Another way to do this is hold down the play/pause button.</li>
<li>Same thing goes for Apps using the Right keypad</li>
<li>Create a new voice recording (bypassing the recording overview screen) by holding down the recording button</li>
<li>The camera resolution can be controlled with the up/down volume keys when in camera mode. The upper left button (voice recorder) changes the camera timer. The flash can be controlled with the upper right softkey.</li>
<li>The contact button (bottom right softkey) in the main menu can go directly to New Contact if you hold it down.</li>
<li>Hold down the up-volume key to go to full volume. Hold down the down-volume key to go to vibrate.</li>
</ul>
<p>That&#8217;s all for now! P.S. Helio: where&#8217;s my firmware upgrade to fix all the wierd inconsistencies?</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2007/06/28/helio-ocean-tips-tricks/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2007/06/28/helio-ocean-tips-tricks/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Five tips for twitter usage in the workplace</title>
		<link>http://yanpritzker.com/2007/03/28/five-tips-for-twitter-usage-in-the-workplace/</link>
		<comments>http://yanpritzker.com/2007/03/28/five-tips-for-twitter-usage-in-the-workplace/#comments</comments>
		<pubDate>Wed, 28 Mar 2007 20:49:13 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://skwpspace.com/2007/03/28/five-tips-for-twitter-usage-in-the-workplace/</guid>
		<description><![CDATA[Here are some ideas for using twitter for work. We use this for Planypus since our team is highly distributed (both geographically and temporally). Sadly twitter doesn&#8217;t have true group support so what we&#8217;ve done is create private twitter accounts for our team and befriended each other. Those of us who have public twitter accounts [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some ideas for using twitter for work. We use this for <a href="http://planyp.us">Planypus</a> since our team is highly distributed (both geographically and temporally). Sadly twitter doesn&#8217;t have true group support so what we&#8217;ve done is create private twitter accounts for our team and befriended each other. Those of us who have public twitter accounts use those separately.</p>
<p>1. Use twitter for lightweight status updates (instead of emailing team@) – example: i am upgrading our hosting account, or I am refactoring something</p>
<p>2. Use twitter to ask a question when you don’t know who should answer it – example: has anyone touched my code? has anyone talked to Bob about Task X?</p>
<p>3. Do not use twitter as a chatroom. Pretend it&#8217;s a reply-all email, if you wouldn&#8217;t do it there, take it offline and talk to the person directly.</p>
<p>4. Tweet once or twice a day to let the team know what you’re working on. It helps keep the ball rolling and identify roadblocks without relying on once-a-week meetings. </p>
<p>5. If going on vacation or extended leave, you can turn off twitter updates and use the rss feed to pull a once a day list of everything that happened. Using the guidelines above the tweets for the day should be a list of about 10 items so it&#8217;s easy to digest. </p>
<p>6. (ok I lied about only having five) Use a twitter client or twitter gtalk bot to keep updated. The website is ridiculously slow.</p>
<p>7. If you&#8217;re on the road and it&#8217;s easier to reply to a twitter than to private message someone, use the direct messaging feature &#8220;d [username] message&#8221; to keep things private but use twitter as a preferred routing mechanism.</p>
<p>How are you using twitter in your workplace?</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2007/03/28/five-tips-for-twitter-usage-in-the-workplace/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2007/03/28/five-tips-for-twitter-usage-in-the-workplace/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dynamically adding routes from your engine plugins</title>
		<link>http://yanpritzker.com/2007/03/27/dynamically-adding-routes-from-your-engine-plugins/</link>
		<comments>http://yanpritzker.com/2007/03/27/dynamically-adding-routes-from-your-engine-plugins/#comments</comments>
		<pubDate>Tue, 27 Mar 2007 19:08:30 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://skwpspace.com/2007/03/27/dynamically-adding-routes-from-your-engine-plugins/</guid>
		<description><![CDATA[At Cohesive FT I am developing a sort of webmin console that has drop-in pluggable components. I am using the RoR plugin system with the engines plugin to drop entire chunks of MVC infrastructure into my application as required. This is all well and good except that rails engines require you to add this line [...]]]></description>
			<content:encoded><![CDATA[<p>At <a href="http://cohesiveft.com">Cohesive FT</a> I am developing a sort of webmin console that has drop-in pluggable components. I am using the RoR plugin system with the engines plugin to drop entire chunks of MVC infrastructure into my application as required. This is all well and good except that rails engines require you to add this line into your routes.rb:</p>
<p><code>map.from_plugin :your_plugin_name</code></p>
<p>Now since I want a truly plug-n-play system, I can&#8217;t be modifying the route file of my main application. So here is a quick solution to import all the routes (note that in engine-plugin style you do not use the &#8220;map.&#8221; prefix for your routes, so I am adding that in)</p>
<p><code><br />
  #--routes.rb of the main applicatoin--<br />
  Dir["#{RAILS_ROOT}/vendor/plugins/*"].each do |plugin|<br />
    File.open("#{plugin}/routes.rb").each do |line|<br />
      eval "map.#{line}"<br />
    end<br />
  end<br />
</code></p>
<p>That&#8217;s all folks!</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2007/03/27/dynamically-adding-routes-from-your-engine-plugins/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2007/03/27/dynamically-adding-routes-from-your-engine-plugins/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bugtracking in the new millenium: how to build a better mouse..err..bug trap</title>
		<link>http://yanpritzker.com/2007/01/03/bugtracking-in-the-new-millenium-how-to-build-a-better-mouseerrbug-trap/</link>
		<comments>http://yanpritzker.com/2007/01/03/bugtracking-in-the-new-millenium-how-to-build-a-better-mouseerrbug-trap/#comments</comments>
		<pubDate>Wed, 03 Jan 2007 00:33:19 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://skwpspace.com/2007/01/03/bugtracking-in-the-new-millenium-how-to-build-a-better-mouseerrbug-trap/</guid>
		<description><![CDATA[It&#8217;s not Bugzilla&#8217;s fault that it sucks. When most of the bug tracking projects out there were started, we didn&#8217;t know rss, we didn&#8217;t understand tagging, we thought in terms of fields and hierarchies, and we thought proper usability and web design were out of our reach and not as important as getting a functional [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not Bugzilla&#8217;s fault that it sucks. When most of the bug tracking projects out there were started, we didn&#8217;t know rss, we didn&#8217;t understand tagging, we thought in terms of fields and hierarchies, and we thought proper usability and web design were out of our reach and not as important as getting a functional product out. Unfortunately some of the newer ones aren&#8217;t quite getting it right either. Well it&#8217;s time for a change. Someone has to build a better bug tracker, and here&#8217;s what you need to do it:</p>
<li> <b>Tags.</b> I don&#8217;t need to fill out the ten fields _you_ think my bug should have. I want to use my own system to organize bugs how I want. Instead of giving me 5 dropdowns, give me one textbox and a del.icio.us-style autocompletion system with tag suggest. Instead of the minute it takes me to fill out a bunch of dropdowns, I&#8217;ll just type &#8220;priority:1 release:2 interface backend !important&#8221;. I also want the del.icio.us people-networking system. I can suggest someone look at a bug using a tag &#8220;for:bob&#8221;. I suppose I can assign them to &#8220;assign:frank&#8221;, but I prefer that engineers &#8216;take&#8217; bugs. Most tags will be free of semantics, leaving the user to create his own categorization system, but we can have a few helpful things like a special meaning for project or people tags.</li>
<li> <b>Intelligent Bug Search.</b> How many times have we had duplicate bugs input into the system by people too lazy to search for similar bugs that had already been reported? While I enter my bug data I want a panel alongside it to do a search for me in the background while I&#8217;m typing. Search should be based on keywords in my bug title and description. It should suggest a list of bugs which I can mouseover for a preview and pull in data from them as appropriate or simply abandon my entry in favor of another already reported bug.</li>
<li> <b>N-dimensional reporting system based on tags.</b> Use my tags to create graphs. Which release is having the most bugs? Is there a particular feature that is in trouble? A particular engineer who is swamped with bugs? All these things can be done by manipulating tag queries. No custom work needed, just give me the flexibility.</li>
<li> <b>Easy state flow.</b> Engineers should take bugs from a queue (self-assignment). As such, I want each bug to have an instantaneous &#8220;take&#8221;, and &#8220;put back&#8221; toggle. It should take one click for the bug to become mine or to be put back (with a comment on why it&#8217;s been put on hold). Maybe the toggle is between three states: &#8220;mine&#8221;,&#8221;nobodys&#8221;,&#8221;on hold&#8221; (meaning its mine but I won&#8217;t work on it right now). Nonetheless it should require only one click.</li>
<li> <b>Automatic flow of tickets.</b> Most successful projects these days have some sort of email reporting system&#8230;if there is a bug in production an email may be generated. The bug tracker should accept these emails into a queue. They should be easy to turn into bugs with a few clicks after a review: &#8220;discard/hold/make bug&#8221;. On that note, I want to be able to submit bugs by email too with special tags in the email so I don&#8217;t have to visit the site. Or a bookmarklet or browser plugin to do this. Give me the ability to tag incoming emails and set up filters based on source (for example support tickets from one channel, auto-generated exception reports in another channel). Also, desktop widgets.</li>
<li> <b>RSS.</b> There is no way to have a successful bug system without rss feeds for everything. Subscribe to the full feed, or based on any number of tags. The del.icio.us subscription system is pretty effective here (subscribing to tags, or people).</li>
<li> <b>Good design.</b> Color code and sort bugs properly. Give elements normal padding. Make the system visually pleasing. The nicer it looks the more I will feel comfortable in looking at it as I&#8217;m putting in bugs.</li>
<li> <b>Proper URLs and bookmarking.</b> The newer bugtrackers like collaboa are already doing this. Something like bugs.com/ticket/123, or bugs.com/tickets/tag/project:foo. This also gives power users a easy way to construct queries or bookmark their favorite locations. All urls should be human understandable. No &#8220;?queryparams=crap&#8221;.</li>
<li> <b>Easy set up.</b> It should either be packaged and sold as a virtual appliance or as a hosted service. Bug tracking is not my core business and it&#8217;s a waste of resources to set up and maintain such a system in house. This of course implies proper upgradability (auto-updates) in the case of the virtual appliance.</li>
<li> <b>Extensible.</b> Each action in the system should trigger an eventing system (script-based, or webservices based). For example, if I mark bug123 fixed, I can have a onFixed hook that invokes &#8220;mywebservice.com/fixed/bug123&#8243; based on my configuration. Or it invokes the script &#8220;scripts/events/fixed&#8221; passing the bug as a parameter. The implementor can do what they want there..useful for tying into other project management systems, etc</li>
<li> <b>Modular, portal-like.</b> Now that I have good urls and rss feeds for everything I can easily set up a pageflakes/netvibes style portal view where I have a number of boxes containing my favorite searches (JIRA does this in a half assed and overcomplicated way, but not as simple and powerful as just having good URLs and rss feeds). Let me color code my boxes and move them around on my screen as I please.</li>
<p>What did I miss?</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2007/01/03/bugtracking-in-the-new-millenium-how-to-build-a-better-mouseerrbug-trap/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2007/01/03/bugtracking-in-the-new-millenium-how-to-build-a-better-mouseerrbug-trap/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Virtual Appliances running a rails admin console</title>
		<link>http://yanpritzker.com/2006/12/06/virtual-appliances-running-a-rails-admin-console/</link>
		<comments>http://yanpritzker.com/2006/12/06/virtual-appliances-running-a-rails-admin-console/#comments</comments>
		<pubDate>Wed, 06 Dec 2006 00:15:10 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://skwpspace.com/2006/12/06/virtual-appliances-running-a-rails-admin-console/</guid>
		<description><![CDATA[Hello everyone, it&#8217;s been a while since I&#8217;ve written here mostly because I&#8217;ve been super busy at My new job at CohesiveFT. It&#8217;s been a fun and hectic several weeks, as I was dumped head first into a brand new environment and technology&#8211;building virtual appliances! We released two new versions of our financial trading appliances [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone, it&#8217;s been a while since I&#8217;ve written here mostly because I&#8217;ve been super busy at <a href="http://cohesiveft.com">My new job at CohesiveFT</a>. It&#8217;s been a fun and hectic several weeks, as I was dumped head first into a brand new environment and technology&#8211;building virtual appliances! </p>
<p>We released two new versions of our financial trading appliances available <a href="http://cohesiveft.com">on our website for free download</a>. The virtual appliances can be run in vmware or Parallels, and feature a web admin console I wrote in Ruby on Rails (but of course). So you can boot them up on pretty much any environment and you&#8217;ve got a nice plug-n-play way to administer the appliance and so on.</p>
<p>Of course, all of my other copious spare time has been taken up by <a href="http://planyp.us">Planypus</a>, where we have recently surpassed 1200 registered users! Come check it out and start making plans with your friends the easy way!</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2006/12/06/virtual-appliances-running-a-rails-admin-console/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2006/12/06/virtual-appliances-running-a-rails-admin-console/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 ways to get insane productivity boosts for coders</title>
		<link>http://yanpritzker.com/2006/10/03/five-ways-to-get-insane-productivity-boosts/</link>
		<comments>http://yanpritzker.com/2006/10/03/five-ways-to-get-insane-productivity-boosts/#comments</comments>
		<pubDate>Tue, 03 Oct 2006 17:23:12 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://skwpspace.com/2006/10/03/five-ways-to-get-insane-productivity-boosts/</guid>
		<description><![CDATA[It is said that really good programmers are orders of magnitude more productive than the average ones. What makes this the case? And why isn&#8217;t this the case in other industries? I believe the answer lies in that computers are very good at automation. And good programmers know how to make computers do what they [...]]]></description>
			<content:encoded><![CDATA[<p>It is said that really good programmers are orders of magnitude more productive than the average ones. What makes this the case? And why isn&#8217;t this the case in other industries? I believe the answer lies in that computers are very good at automation. And good programmers know how to make computers do what they do best: that is, automate things. The best programmers are the ones who undersand this so well that they will not only solve the task they are directly working on, but learn to automate every step of the very process that leads them there. Here are some useful tips that may seem like common sense, except that most good programmers never go from good to great because of this.</p>
<p>1.<strong> Never look when you can search. </strong> Why look when you can search? Even if you&#8217;re looking for one item in a list of ten, it is always faster to type three or four characters than to scan the list with your eyes. Most reasonable environments including the popular editors and IDEs offer at least some way to do inline completion-based searching. Hit the shortcut and type the first couple characters identifying what you&#8217;re looking for and you&#8217;re there.</p>
<p>2. <strong>Don&#8217;t repeat yourself. </strong> Are you typing the same thing over and over? Make a shortcut out of it. Use global keyboard shortcuts to call up your favorite apps. On OSX/Unix, <code>alias</code> is your friend. Make two character mnemonic aliases for <em>everything</em>. Corollary: <strong>Never Mouse when you can Key</strong>. A good approach to learning built in shortcuts is every time you reach for your mouse, make a note of the shortcut key for the action you&#8217;re performing, and then let go of the mouse and execute the action from the keyboard. Then do it two more times. </p>
<p>3.<strong> Learn a scripting language. </strong> Bash, Perl, Ruby, Python. Pick one and learn it. Perl used to be the king of one liners. These days I find myself reaching for ruby more because I use it on a daily basis anyway. Automate common tasks with bash and ruby.</p>
<p>4. <strong>Learn an editor.</strong> I mean a real editor. Both vi and emacs are acceptable choices here. Some people like TextMate but after PeepOpen came out for vim, delivering vim&#8217;s One Missing Feature, there&#8217;s really no reason to use TextMate over vim. With insanely fast window spitting, buffer searching, and text manipulation, you&#8217;ll save yourself thousands of keystrokes a day by using vim. There are <a href="http://github.com/skwp/dotfiles">good dotfiles that make it look just like TextMate</a> anyway. </p>
<p>Corollary: <strong>Use that editor everywhere. </strong>Now that you know vi, type <em>set -o vi</em> on your bash command line. Now use vi to edit your command line. Instantaneous productivity boost of about 10x. If you&#8217;re an Eclipse junky, use the <A href="http://www.satokar.com/viplugin/index.php">Vi plugin for Eclipse</a>.  </p>
<p>If you learn one thing in vi: learn to move around using the home row keys, skip words using <em>w</em>, <em>b</em> and change commands such as <em>cw</em> (change word), or <em>ctA</em> (change from current position until the next occurrence of A). This becomes second nature because you look ahead as you type the command to achieve efficiency. There are plenty of tutorials, use google or the built in vi help system.</p>
<p>5. <strong>Learn regular expressions.</strong> There is no excuse not to know at least the basics. You don&#8217;t have to be a regex guru, just be functional. It probably takes a lifetime of meditation to achieve true regex enlightenment. But spending an hour a day trying to use regexes will take you 80% of the way. Read the perlre manpages, that&#8217;s where I got my start. Learn to use regexes in your editor to search, on your command line for quick one off scripts, in your programs to do text manipulation. </p>
<p>None of these things are hard, they just take practice and dedication to become true habits. The most important way to turn them into habits is to establish a routine that forces you to apply one or more of these principles and ideas every day. </p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2006/10/03/five-ways-to-get-insane-productivity-boosts/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2006/10/03/five-ways-to-get-insane-productivity-boosts/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Rails request log filtering</title>
		<link>http://yanpritzker.com/2006/08/30/rails-request-log-filtering/</link>
		<comments>http://yanpritzker.com/2006/08/30/rails-request-log-filtering/#comments</comments>
		<pubDate>Wed, 30 Aug 2006 17:39:10 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://skwpspace.com/?p=16</guid>
		<description><![CDATA[Just as I was thinking of writing a plugin to filter sensitive data from request logs, I googled and found that the core guys had snuck something into the 1.1.6 release to do just that: read the blog. Sweet!]]></description>
			<content:encoded><![CDATA[<p>Just as I was thinking of writing a plugin to filter sensitive data from request logs, I googled and found that the core guys had snuck something into the 1.1.6 release to do just that: <a href="http://weblog.rubyonrails.org/2006/8/21/filtered-parameter-logging">read the blog</a>. Sweet!</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2006/08/30/rails-request-log-filtering/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2006/08/30/rails-request-log-filtering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encrypted db passwords for Rails with database.yml and erb</title>
		<link>http://yanpritzker.com/2006/08/29/encrypted-db-passwords-for-rails-with-databaseyml-and-erb/</link>
		<comments>http://yanpritzker.com/2006/08/29/encrypted-db-passwords-for-rails-with-databaseyml-and-erb/#comments</comments>
		<pubDate>Tue, 29 Aug 2006 00:49:53 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://skwpspace.com/?p=17</guid>
		<description><![CDATA[Some people are upset that database.yml can expose passwords in plaintext. However, there is a pretty simple way to get encryption into database.yml. Because the database.yml file is actually run through an ERB interpreter by Rails, we can put code into our file: ##### database.yml ##### production: adapter: oci username: user password: &#60;%= PROD_DB_PASSWORD.decrypt(PROD_KEYFILE) %&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Some people are upset that database.yml can expose passwords in plaintext. However, there is a pretty simple way to get encryption into database.yml. Because the database.yml file is actually run through an ERB interpreter by Rails, we can put code into our file:</p>
<pre class="textmate-source black_pearl"><span class="source source_yaml"><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml">##### database.yml #####</span>
<span class="meta meta_tag meta_tag_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">production</span><span class="keyword keyword_operator keyword_operator_symbol">:</span>
</span>  <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">adapter<span class="keyword keyword_operator keyword_operator_symbol">:</span></span> <span class="string string_unquoted string_unquoted_yaml">oci</span></span>
  <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">username<span class="keyword keyword_operator keyword_operator_symbol">:</span></span> <span class="string string_unquoted string_unquoted_yaml">user</span></span>
  <span class="meta meta_tag meta_tag_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">password</span><span class="keyword keyword_operator keyword_operator_symbol">:</span> </span><span class="source source_ruby source_ruby_rails source_ruby_rails_embedded source_ruby_rails_embedded_html">&lt;%= <span class="variable variable_other variable_other_constant variable_other_constant_ruby">PROD_DB_PASSWORD</span>.decrypt(<span class="variable variable_other variable_other_constant variable_other_constant_ruby">PROD_KEYFILE</span>) %&gt;</span>
  <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">host<span class="keyword keyword_operator keyword_operator_symbol">:</span></span> <span class="string string_unquoted string_unquoted_yaml">host/schema</span></span></span></pre>
<pre class="textmate-source black_pearl"><span class="source source_ruby source_ruby_rails"><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby">####### local.rb #######
</span><span class="meta meta_class meta_class_ruby"><span class="keyword keyword_control keyword_control_class keyword_control_class_ruby">class</span> <span class="entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby">String</span></span>
<span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby">  <span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">decrypt</span>(<span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">keyfile</span>)</span>
<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby">   #do some magic to apply the keyfile to the password
</span>  <span class="keyword keyword_control keyword_control_ruby">end</span>
<span class="keyword keyword_control keyword_control_ruby">end</span>
</span></pre>
<p>That&#8217;s all there is to it! Simply plugin any key-based encryption routine in there. In my case we were using a triple des two way encryption that was actually done by an external Java program. I simply invoked the java interpeter using backticks and got the output which was my decrypted password.</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2006/08/29/encrypted-db-passwords-for-rails-with-databaseyml-and-erb/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2006/08/29/encrypted-db-passwords-for-rails-with-databaseyml-and-erb/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Consuming document literal SOAP webservices with Ruby and ROXML</title>
		<link>http://yanpritzker.com/2006/08/23/consuming-document-literal-soap-webservices-with-ruby-and-roxml/</link>
		<comments>http://yanpritzker.com/2006/08/23/consuming-document-literal-soap-webservices-with-ruby-and-roxml/#comments</comments>
		<pubDate>Wed, 23 Aug 2006 20:14:38 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://skwpspace.com/?p=4</guid>
		<description><![CDATA[Ruby support for consuming doclit webservices is still less than stellar. Recently I had the task of integrating a standalone RoR application with a backend Java core login system via webservices. Because of our complex schema, soap4r would not work well for creating the data binding objects. Instead, I discovered a very simple and concise [...]]]></description>
			<content:encoded><![CDATA[<p>Ruby support for consuming doclit webservices is still less than stellar. Recently I had the task of integrating a standalone RoR application with a backend Java core login system via webservices. Because of our complex schema, soap4r would not work well for creating the data binding objects. Instead, I discovered a very simple and concise way to do xml binding using ROXML.</p>
<p>These objects are sort of the combination of what you might find in a traditional Java XML binding framework such as JiBX, except in Java you’ll typically write the object and then write an xml mapping file. ROXML feels more like Java annotations, where you write the object which is simultaneously the specification for how to marshall/unmarshall it.</p>
<pre><code># lang ruby
class LoginReq
include ROXML, Initializable
xml_name "LoginReq"
xml_attribute :xmlns
xml_object :Credentials, Credentials
end

class Credentials
include ROXML, Initializable
xml_name “Credentials”
xml_attribute :UserId
xml_attribute :Password
end
</code></pre>
<p>Here’s a really simple login request object with a sub element of Credentials. It’s  that simple! Now i’ve got some objects that can read and write xml:</p>
<pre><code># lang ruby
loginReq = LoginReq.new(:xmlns =&gt; NS, :Credentials =&gt; Credentials.new(
     :UserId =&gt; username, :Password =&gt; password) )
xml = loginReq.to_xml.to_s
</code></pre>
<p>To make this work with webserivices, all you’ll need to do is wrap the xml generated with some soap headers which can be hardcoded as constants.</p>
<pre><code># lang ruby
def send_request(xml)
data = SOAP_HEAD + xml + SOAP_FOOT
response = Net::HTTP.start(host, port) {|http| http.post2(path, data,
     {"Content-Type" => "text/xml"}) }
end
</code></pre>
<p>On the way back, all you have to do is strip off the soap headers, and then unmarshall the xml back into an object</p>
<pre><code># lang ruby
response_body = response.strip_soap #this just uses a regex to get rid of the extra soap crud again
loginRsp = LoginRsp.parse(response)
</code></pre>
<p>The last piece of magic here is the Initializable module which simply allows you to initialize any class by passing in a hash of its attributes:</p>
<pre><code># lang ruby
module Initializable
def initialize(options);  options.each{|k,v|  self.send("#{k}=",v) };  end
end
</code></pre>
<p>Here are the headers and RE for stripping them</p>
<pre><code># lang ruby
SOAP_HEAD = %{ &lt;soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;soapenv:Body&gt; }
SOAP_FOOT = %{ &lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt; }
XML_RE = /&lt;?xml[^&gt;]+&gt;/
SOAP_ENV_RE = /&lt;w+:Envelope.*&gt;&lt;w+:Body&gt;(.*)&lt;/w+:Body&gt;&lt;/w+:Envelope&gt;/
</code></pre>
<p>Now this may not be as automatic as generating the objects from wsdl, but on the other hand it allows you to extend your model objects and give them rich functionality along with the included xml binding skills they inherit from ROXML. And for now, this may be the only way to talk to complex webservices, whose wsdl is less than ideal for Soap4R. Enjoy!</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2006/08/23/consuming-document-literal-soap-webservices-with-ruby-and-roxml/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2006/08/23/consuming-document-literal-soap-webservices-with-ruby-and-roxml/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

