<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>yaqrb</title>
    <link>http://srejbi.info</link>
    <description>YAQRB - Yet Another Quick Rails Blog</description>
    <language>en-us</language>
    <item>
      <title>automatic mounting broken (again) in Ubuntu 10.04 - Lucid Lynx</title>
      <description>&lt;p&gt;When seeing this message, I was wondering how this can come back again, as I have fixed it a long while ago by editing the &lt;strong&gt;/usr/share/polkit-1/actions/org.freedesktop.devicekit.disks.policy&lt;/strong&gt; file (in Karmic Koala) allowing any user &amp;#8212; not just the active ones &amp;#8212; to mount usb harddrives. But, this file was gone&amp;#8230; :(&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;#8230;if not interested in the intermezzos, just the fix, scroll to the end&amp;#8230; :)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;However, discovered a new &amp;#8220;suspicious&amp;#8221; file in the same directory: &lt;strong&gt;/usr/share/polkit-1/actions/org.freedesktop.udisks.policy&lt;/strong&gt;. I opened it with great hopes, and was not disappointed, right at the beginning was this section:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;code class=&quot;xml&quot;&gt;
  &amp;lt;action id=&quot;org.freedesktop.udisks.filesystem-mount&quot;&amp;gt;
    &amp;lt;description&amp;gt;Mount a device&amp;lt;/description&amp;gt;
    &amp;lt;description xml:lang=&quot;da&quot;&amp;gt;Mont&#233;r en enhed&amp;lt;/description&amp;gt;
    &amp;lt;description xml:lang=&quot;de&quot;&amp;gt;Ger&#228;t einh&#228;ngen&amp;lt;/description&amp;gt;
    &amp;lt;message&amp;gt;Authentication is required to mount the device&amp;lt;/message&amp;gt;
    &amp;lt;message xml:lang=&quot;da&quot;&amp;gt;Autorisering er p&#229;kr&#230;vet for at montere et fil system&amp;lt;/message&amp;gt;
    &amp;lt;message xml:lang=&quot;de&quot;&amp;gt;Zugriffsrechte werden ben&#246;tigt um das Ger&#228;t einzuh&#228;ngen&amp;lt;/message&amp;gt;
    &amp;lt;defaults&amp;gt;
      &amp;lt;allow_any&amp;gt;no&amp;lt;/allow_any&amp;gt;
      &amp;lt;allow_inactive&amp;gt;no&amp;lt;/allow_inactive&amp;gt;
      &amp;lt;allow_active&amp;gt;yes&amp;lt;/allow_active&amp;gt;
    &amp;lt; /defaults&amp;gt;
  &amp;lt; /action&amp;gt;
&lt;/code&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;thought that I simply switch the following values, and that will be it:&lt;/p&gt;
&lt;pre&gt;
&lt;code class=&quot;xml&quot;&gt;
      &amp;lt;allow_any&amp;gt;yes&amp;lt;/allow_any&amp;gt;
      &amp;lt;allow_inactive&amp;gt;yes&amp;lt;/allow_inactive&amp;gt;
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;well, doing it (and restarting policykit) was a disappointment, I still had these &amp;#8220;Not Authorized&amp;#8221; messages when plugging my external &lt;span class=&quot;caps&quot;&gt;HDD&lt;/span&gt; in (or trying to mount it with Nautilus in my &lt;span class=&quot;caps&quot;&gt;VNC&lt;/span&gt; session)&amp;#8230;&lt;/p&gt;
&lt;p&gt;Anyway, after some time googling I found nothing but some people complaining about the same thing&amp;#8230; I tried reinstalling &lt;strong&gt;policykit&lt;/strong&gt;, &lt;strong&gt;policykit-gnome&lt;/strong&gt;, &lt;strong&gt;policykit-desktop-privileges&lt;/strong&gt;, &lt;strong&gt;policykit-1&lt;/strong&gt;, etc. no use.&lt;/p&gt;
&lt;p&gt;Finally, this pointed me in the right direction:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;locate policykit&lt;/strong&gt;&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&amp;#8230;&lt;br /&gt;
/var/lib/dpkg/info/policykit-1.list&lt;br /&gt;
/var/lib/dpkg/info/policykit-1.md5sums&lt;br /&gt;
/var/lib/dpkg/info/policykit-1.postinst&lt;br /&gt;
/var/lib/dpkg/info/policykit-desktop-privileges.list&lt;br /&gt;
/var/lib/dpkg/info/policykit-desktop-privileges.md5sums&lt;br /&gt;
/var/lib/dpkg/info/policykit-gnome.list&lt;br /&gt;
/var/lib/dpkg/info/policykit-gnome.md5sums&lt;br /&gt;
&amp;#8230;&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;let&amp;#8217;s see what the desktop privileges package installs:&lt;br /&gt;
&lt;strong&gt;cat /var/lib/dpkg/info/policykit-desktop-privileges.list&lt;/strong&gt;&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
/.&lt;br /&gt;
/var&lt;br /&gt;
/var/lib&lt;br /&gt;
/var/lib/polkit-1&lt;br /&gt;
/var/lib/polkit-1/localauthority&lt;br /&gt;
/var/lib/polkit-1/localauthority/10-vendor.d&lt;br /&gt;
/var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla&lt;br /&gt;
/usr&lt;br /&gt;
/usr/share&lt;br /&gt;
/usr/share/doc&lt;br /&gt;
/usr/share/doc/policykit-desktop-privileges&lt;br /&gt;
/usr/share/doc/policykit-desktop-privileges/copyright&lt;br /&gt;
/usr/share/doc/policykit-desktop-privileges/changelog.gz&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;ok, eager to see that policy file:&lt;br /&gt;
&lt;strong&gt;cat /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla&lt;/strong&gt;&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
[Mounting, checking, etc. of internal drives]&lt;br /&gt;
Identity=unix-group:admin&lt;br /&gt;
Action=org.freedesktop.udisks.filesystem-&lt;strong&gt;;org.freedesktop.udisks.drive-ata-smart&lt;/strong&gt;&lt;br /&gt;
ResultActive=yes&lt;/p&gt;
&lt;p&gt;[Change &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; Frequency scaling]&lt;br /&gt;
Identity=unix-group:admin&lt;br /&gt;
Action=org.gnome.cpufreqselector&lt;br /&gt;
ResultActive=yes&lt;/p&gt;
&lt;p&gt;[Setting the clock]&lt;br /&gt;
Identity=unix-group:admin&lt;br /&gt;
Action=org.gnome.clockapplet.mechanism.*&lt;br /&gt;
ResultActive=yes&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;SOLUTION&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;ok, the structure and values in the file, especially &amp;#8220;ResultActive&amp;#8221; looked promising (I must admit, at this point I was too impatient and sleepy, so did not do further readings on the subject), so I just added the following 2 lines after every section in the file:&lt;br /&gt;
&lt;strong&gt;nano -w /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla&lt;/strong&gt; (sudo if you&amp;#8217;re using your regular user account)&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
ResultAny=auth_admin&lt;br /&gt;
ResultInactive=yes&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;restarted policykit, and suddenly I could mount from Nautilus again&amp;#8230; :)&lt;/p&gt;</description>
      <author>srejbi</author>
      <pubDate>Sat, 05 Jun 2010 12:48:29 +0000</pubDate>
      <link>http://srejbi.info/posts/8_automatic-mounting-broken-again-in-ubuntu-10-04-lucid-lynx</link>
      <guid>http://srejbi.info/posts/8_automatic-mounting-broken-again-in-ubuntu-10-04-lucid-lynx</guid>
    </item>
    <item>
      <title>XBMC on Ubuntu 10.04 Lucid Lynx</title>
      <description>&lt;p&gt;After the upgrade from Karmic Koala to Lucid Lynx (and re-enabling lucid package sources, reinstalling the appropriate xbmc packages), the video playback was producing some strange results; while audio and subtitles were displayed nicely, the screen was just flashing in different colours where it should have shown video&amp;#8230;&lt;/p&gt;
&lt;p&gt;The xbmc.log was not in any way suspicious to me (no errors, warnings, complaints about display or rendering).&lt;/p&gt;
&lt;p&gt;The best solution for the time being was to go to &lt;strong&gt;System / Video / Playback&lt;/strong&gt; in &lt;span class=&quot;caps&quot;&gt;XBMC&lt;/span&gt; and change &lt;strong&gt;Render method&lt;/strong&gt; from &lt;strong&gt;Auto detect&lt;/strong&gt; to either &lt;strong&gt;Software&lt;/strong&gt; or to &lt;strong&gt;Basic shaders (&lt;span class=&quot;caps&quot;&gt;ARB&lt;/span&gt;)&lt;/strong&gt;. &lt;em&gt;Basic shaders look slightly better to me, also that should utilize the &lt;span class=&quot;caps&quot;&gt;GPU&lt;/span&gt; instead the &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; so that&amp;#8217;s what I set for my box.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;VDPAU&lt;/span&gt;&lt;/strong&gt; and &lt;strong&gt;Advanced shaders (&lt;span class=&quot;caps&quot;&gt;GLSL&lt;/span&gt;)&lt;/strong&gt; are both producing the forementioned colourful psychedelic effect.&lt;/p&gt;
&lt;p&gt;The box is an EeeBox B206 with a Radeon &lt;span class=&quot;caps&quot;&gt;HDMI&lt;/span&gt; card:&lt;br /&gt;
&lt;pre&gt;lspci | grep -i vga&lt;br /&gt;
03:00.0 &lt;span class=&quot;caps&quot;&gt;VGA&lt;/span&gt; compatible controller: &lt;span class=&quot;caps&quot;&gt;ATI&lt;/span&gt; Technologies Inc Mobility Radeon HD 3400 Series&lt;/pre&gt;, using the fglrx driver.&lt;/p&gt;</description>
      <author>srejbi</author>
      <pubDate>Sat, 05 Jun 2010 12:01:52 +0000</pubDate>
      <link>http://srejbi.info/posts/7_xbmc-on-ubuntu-10-04-lucid-lynx</link>
      <guid>http://srejbi.info/posts/7_xbmc-on-ubuntu-10-04-lucid-lynx</guid>
    </item>
    <item>
      <title>selenium-on-rails on rails 2.3.5</title>
      <description>&lt;p&gt;Supposing you installed already the &lt;a href=&quot;http://seleniumhq.org/&quot;&gt;Selenium&lt;/a&gt; gem (&lt;em&gt;gem install Selenium&lt;/em&gt; &amp;#8212; mind the capital &amp;#8216;S&amp;#8217;) and installed the &lt;a href=&quot;http://github.com/paytonrules/selenium-on-rails/&quot;&gt;selenium-on-rails&lt;/a&gt; plugin, but run into the following error when trying to run the Rakefile for Selenium:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
cd [project]/vendor/plugins/selenium-on-rails&lt;br /&gt;
rake&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
results in:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
(in  [project]/vendor/plugins/selenium-on-rails)&lt;br /&gt;
/usr/bin/ruby18 -I&amp;quot;lib:lib&amp;quot; &amp;#8220;/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb&amp;#8221; &amp;#8220;test/selenium_controller_test.rb&amp;#8221; &amp;#8220;test/renderer_test.rb&amp;#8221; &amp;#8220;test/setup_test.rb&amp;#8221; &amp;#8220;test/paths_test.rb&amp;#8221; &amp;#8220;test/selenium_on_rails_config_test.rb&amp;#8221; &amp;#8220;test/selenese_test.rb&amp;#8221; &amp;#8220;test/selenium_support_test.rb&amp;#8221; &amp;#8220;test/switch_environment_controller_test.rb&amp;#8221; &amp;#8220;test/rselenese_test.rb&amp;#8221; &amp;#8220;test/suite_renderer_test.rb&amp;#8221; &lt;br /&gt;
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:105:in `const_missing&amp;#8217;: uninitialized constant ActionView::Base::Helpers (NameError)&lt;br /&gt;
	from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_view/base.rb:163&lt;br /&gt;
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require&amp;#8217;&lt;br /&gt;
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require&amp;#8217;&lt;br /&gt;
	from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require&amp;#8217;&lt;br /&gt;
	from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in&amp;#8217;&lt;br /&gt;
	from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require&amp;#8217;&lt;br /&gt;
	from ./test/test_helper.rb:14&lt;br /&gt;
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require&amp;#8217;&lt;br /&gt;
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require&amp;#8217;&lt;br /&gt;
	from ./test/selenium_controller_test.rb:1&lt;br /&gt;
	from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load&amp;#8217;&lt;br /&gt;
	from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5&lt;br /&gt;
	from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each&amp;#8217;&lt;br /&gt;
	from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5&lt;br /&gt;
rake aborted!&lt;br /&gt;
Command failed with status (1): [/usr/bin/ruby18 -I&amp;quot;lib:lib&amp;quot; &amp;quot;/usr/lib/ruby&amp;#8230;]&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;than you probably installed the plugin from the &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; recommended for projects using Rails 2.2 and up&amp;#8230; Apparently this fork has not been updated for 2.3.5 compatibility, fortunately the one in git is. So just do&lt;/p&gt;
&lt;pre&gt;
script/plugin remove selenium-on-rails
script/plugin install git://github.com/paytonrules/selenium-on-rails.git
&lt;/pre&gt;
&lt;p&gt;The errors should be gone&amp;#8230; :)&lt;/p&gt;</description>
      <author>srejbi</author>
      <pubDate>Wed, 12 May 2010 15:55:21 +0000</pubDate>
      <link>http://srejbi.info/posts/6_selenium-on-rails-on-rails-2-3-5</link>
      <guid>http://srejbi.info/posts/6_selenium-on-rails-on-rails-2-3-5</guid>
    </item>
    <item>
      <title>linux_fortune</title>
      <description>&lt;p&gt;being a linux enthusiast, when looking for quotes for this blog &amp;#8211; and playing with ruby / learning how to write and package gems &amp;#8211; what else could have been my first thought than displaying random quotes using the &amp;#8216;notorious&amp;#8217; &lt;a href=&quot;http://en.wikipedia.org/wiki/Fortune_%28Unix%29&quot;&gt;fortune&lt;/a&gt; program on this blog. &lt;br /&gt;
a quick search on github resulted &lt;a href=&quot;http://github.com/lacco/ruby-fortunes&quot;&gt;lacco&amp;#8217;s ruby-fortunes&lt;/a&gt;  &amp;#8212; a library that provides fortunes using a network service.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;well, i&amp;#8217;m wondering why one needs a fortune webservice (assuming that fortune is needed in a linux-box-hosted-project; others rather need luck and spend a fortune ;-) ), though it&amp;#8217;s definitely a convenient idea to provide network access to fortune.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;anyway, since i have fortune right at my fingertips to my servertops and wanted to play with ruby gem creation, thought to create a gem for linux / unix machines with rails projects. (though it might work on win-whatever too, having &lt;a href=&quot;http://www.alagad.com/projects.fortune&quot;&gt;cygwin&lt;/a&gt; installed for example; have not tested, nor researched this matter or the existence of fortune ports to win)&lt;/p&gt;
&lt;p&gt;the current, humble version 0.0.2 was in fact only tested on &lt;a href=&quot;http://gentoo.org&quot;&gt;gentoo&lt;/a&gt; and a demo has been installed to this blog, on the &lt;a href=&quot;/&quot;&gt;home page&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;installing it was simple as:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;install gem&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
sudo gem install linux_fortune&lt;br /&gt;
&lt;/pre&gt;&lt;/li&gt;
	&lt;li&gt;use the gem (edit config/environment.rb)&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;code class=ruby&gt;
config.gem &quot;linux_fortune&quot;
&lt;/code&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;/li&gt;
	&lt;li&gt;finally call fortune from the site index template the following line:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;code class=html&gt;
&amp;lt;div class=&quot;fortune&quot;&amp;gt;&amp;lt;%= LinuxFortune.generate.body.gsub(/\n/, &quot;&amp;lt;br/&amp;gt;&quot;) %&amp;gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;for more details and source code, see the &lt;a href=&quot;http://github.com/srejbi/linux_fortune&quot;&gt;project page on GitHub&lt;/a&gt;&lt;/p&gt;</description>
      <author>srejbi</author>
      <pubDate>Wed, 24 Mar 2010 00:33:35 +0000</pubDate>
      <link>http://srejbi.info/posts/5_linux_fortune</link>
      <guid>http://srejbi.info/posts/5_linux_fortune</guid>
    </item>
    <item>
      <title>mini_captcha</title>
      <description>&lt;p&gt;&lt;a href=&quot;http://github.com/srejbi/mini_captcha&quot;&gt;mini_captcha&lt;/a&gt; is a minimalistic captcha plugin for rails projects, based on some code developed for a friend&amp;#8217;s website. &lt;br /&gt;
developing another captcha plugin (there are a few other plugins out there) was inspired by the spirit of minimalism:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;not to store images in the db&lt;/li&gt;
	&lt;li&gt;not to keep images with any of the models that might need captcha protection when creating instances&lt;/li&gt;
	&lt;li&gt;keep images only as long as needed (serve once, delete)&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;&lt;span class=&quot;caps&quot;&gt;HOWTO&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;To install and integrate to your rails website, follow these steps:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;install RMagick and Digest &amp;#8212; if not yet installed&lt;/li&gt;
	&lt;li&gt;install mini_captcha:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
script/plugin install git@github.com:srejbi/mini_captcha.git&lt;br /&gt;
&lt;/pre&gt;&lt;/li&gt;
	&lt;li&gt;add the following lines to your application controller:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;code class=&quot;ruby&quot;&gt;
require 'vendor/plugins/mini_captcha/lib/mini_captcha'
include MiniCaptcha::ControllerHelpers
&lt;/code&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;/li&gt;
	&lt;li&gt;add a map to the MiniCaptcha controller for the MiniCaptcha image display&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;code class=&quot;ruby&quot;&gt;
map.mini_captcha '/mini_captcha/:action', :controller =&amp;gt; 'mini_captcha', :action =&amp;gt; 'show_image'
&lt;/code&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;/li&gt;
	&lt;li&gt;add a div like this to any view you want to protect with MiniCaptcha from spam:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;code class=&quot;ruby&quot;&gt;
  ... (your page &amp;amp; form)...
  &amp;lt;div class=&quot;...&quot;&amp;gt;&amp;lt;%= show_mini_captcha  %&amp;gt; &amp;lt;/div&amp;gt;
  ... (your page) ....
&lt;/code&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;/li&gt;
	&lt;li&gt;update the processing controller similarly to the following block:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;code class=&quot;ruby&quot;&gt;
 if @form.valid?    your original validation
       if mini_captcha_valid?  extend it with checking the MiniCaptchaChallenge
         do whatever...
         flash[:notice] = 'Your form input was correct.'
         redirect as you wish
       else                     belongs to your new validation of MiniCaptchaChallenge (failure branch)
         flash[:error] = 'Failed MiniCaptcha Challenge.'
         punish the 'bot, piss off the user (just kidding ;))
       end                      end of yout new block for MiniCaptchaChallenge failure
     end
&lt;/code&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;/li&gt;
	&lt;li&gt;enjoy getting less spam, more real comments :-)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Credits: thanks to &lt;a href=&quot;http://github.com/milkfarm&quot;&gt;milkfarm&lt;/a&gt; for specs, ideas, and actual updates on the code.&lt;/p&gt;
&lt;p&gt;for more details and updates, visit the &lt;a href=&quot;http://github.com/srejbi/mini_captcha&quot;&gt;project page on GitHub&lt;/a&gt;&lt;/p&gt;</description>
      <author>srejbi</author>
      <pubDate>Tue, 23 Mar 2010 22:57:19 +0000</pubDate>
      <link>http://srejbi.info/posts/4_mini_captcha</link>
      <guid>http://srejbi.info/posts/4_mini_captcha</guid>
    </item>
    <item>
      <title>get time estimates from redmine</title>
      <description>&lt;p&gt;though the latest (0.9.x) versions of &lt;a href=&quot;http://www.redmine.org&quot;&gt;Redmine&lt;/a&gt; definitely has improved issues display, still some columns are missing from the view, such as the time spent already and projections of the total time (or time remaining) based on the original estimate, time inputted already and the completion ratio.&lt;/p&gt;
&lt;p&gt;below is my dirty &lt;span class=&quot;caps&quot;&gt;SQL&lt;/span&gt; workaround for getting these base numbers out for simple maths:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;code class=&quot;sql&quot;&gt;
SELECT distinct i.id, fixed_version_id, estimated_hours, done_ratio, SUM(te.hours) AS time_spent, subject 
FROM issues i 
    LEFT OUTER JOIN time_entries te ON i.id = te.issue_id 
WHERE i.project_id = ${project}
GROUP BY i.id 
ORDER BY fixed_version_id ASC, id ASC;
&lt;/code&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;em&gt;where ${project} is your selected project;&lt;/em&gt;&lt;br /&gt;
_ or also one can remove condition, add ordering by &lt;strong&gt;i.project_id&lt;/strong&gt; and see all projects (also could put any other columns there)_&lt;/p&gt;
&lt;p&gt;or do already the simple math for doing linear projections of the remaining time estimate based on the original or on the already spent time:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;code class=&quot;sql&quot;&gt;
SELECT DISTINCT i.id, fixed_version_id, estimated_hours, done_ratio, 
                SUM(te.hours) AS time_spent, 
                (CASE done_ratio WHEN 100 THEN 0 ELSE (estimated_hours*(100-done_ratio)/100) END) AS rem_est_est, 
                (CASE done_ratio WHEN 100 THEN 0 ELSE (SUM(te.hours)*(100/done_ratio)-SUM(te.hours)) END) AS rem_est_done, 
                subject 
FROM issues i LEFT OUTER JOIN time_entries te ON i.id = te.issue_id WHERE i.project_id = ${project} 
GROUP BY i.id 
ORDER BY fixed_version_id ASC, id ASC
&lt;/code&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;these &lt;span class=&quot;caps&quot;&gt;SQL&lt;/span&gt; statements were tested on MySQL, but supposed to work without modification on PostgreSQ. tested with redmine versions 0.8 &amp;#8211; 0.9.2&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;this would result a table like this.&lt;/p&gt;
&lt;table style=&quot;border:1px solid gray;&quot;&gt;
	&lt;tr&gt;
		&lt;td&gt;id&lt;/td&gt;
		&lt;td&gt;fixed_version_id&lt;/td&gt;
		&lt;td&gt;estimated_hours&lt;/td&gt;
		&lt;td&gt;done_ratio&lt;/td&gt;
		&lt;td&gt;time_spent&lt;/td&gt;
		&lt;td&gt;rem_est_est&lt;/td&gt;
		&lt;td&gt;rem_est_done&lt;/td&gt;
		&lt;td&gt;subject&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;1&lt;/td&gt;
		&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;NULL&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;80&lt;/td&gt;
		&lt;td&gt;0&lt;/td&gt;
		&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;NULL&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;80&lt;/td&gt;
		&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;NULL&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;an unstarted issue with estimate&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;2&lt;/td&gt;
		&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;NULL&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;NULL&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;0&lt;/td&gt;
		&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;NULL&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;NULL&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class=&quot;caps&quot;&gt;NULL&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;unstarted issue without estimate&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;3&lt;/td&gt;
		&lt;td&gt;3&lt;/td&gt;
		&lt;td&gt;5&lt;/td&gt;
		&lt;td&gt;100&lt;/td&gt;
		&lt;td&gt;4.70000004023314&lt;/td&gt;
		&lt;td&gt;0&lt;/td&gt;
		&lt;td&gt;0&lt;/td&gt;
		&lt;td&gt;completed issue 1&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;6&lt;/td&gt;
		&lt;td&gt;3&lt;/td&gt;
		&lt;td&gt;8&lt;/td&gt;
		&lt;td&gt;100&lt;/td&gt;
		&lt;td&gt;12.1599999666214&lt;/td&gt;
		&lt;td&gt;0&lt;/td&gt;
		&lt;td&gt;0&lt;/td&gt;
		&lt;td&gt;completed issue 2&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;4&lt;/td&gt;
		&lt;td&gt;4&lt;/td&gt;
		&lt;td&gt;4&lt;/td&gt;
		&lt;td&gt;30&lt;/td&gt;
		&lt;td&gt;1.30000002682209&lt;/td&gt;
		&lt;td&gt;2.8&lt;/td&gt;
		&lt;td&gt;3.033290062584&lt;/td&gt;
		&lt;td&gt;issue progressing slightly worse than estimated&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;5&lt;/td&gt;
		&lt;td&gt;4&lt;/td&gt;
		&lt;td&gt;6&lt;/td&gt;
		&lt;td&gt;10&lt;/td&gt;
		&lt;td&gt;1.89999997615814&lt;/td&gt;
		&lt;td&gt;5.4&lt;/td&gt;
		&lt;td&gt;17.099999785423&lt;/td&gt;
		&lt;td&gt;issue progressing much worse than estimated&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;7&lt;/td&gt;
		&lt;td&gt;4&lt;/td&gt;
		&lt;td&gt;16&lt;/td&gt;
		&lt;td&gt;60&lt;/td&gt;
		&lt;td&gt;7.95000000298023&lt;/td&gt;
		&lt;td&gt;6.4&lt;/td&gt;
		&lt;td&gt;5.3002650019869&lt;/td&gt;
		&lt;td&gt;issue progressing better than estimated&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;8&lt;/td&gt;
		&lt;td&gt;4&lt;/td&gt;
		&lt;td&gt;3&lt;/td&gt;
		&lt;td&gt;90&lt;/td&gt;
		&lt;td&gt;1.5&lt;/td&gt;
		&lt;td&gt;0.3&lt;/td&gt;
		&lt;td&gt;0.16665&lt;/td&gt;
		&lt;td&gt;issue progressing much better than estimated&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;how realistic are these figures?&lt;/strong&gt; i do not know &amp;#8212; it all comes down to the issue specs. the high resolution and precisely detailed issue specification is the key factor to increase the precision of initial and ongoing estimates (completion ratio), generally speaking. however there could be an entire post about it&amp;#8230;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;anyway, back to the original topic; the above &lt;span class=&quot;caps&quot;&gt;SQL&lt;/span&gt; is good enough for me to keep tracking how my &amp;#8211; often lousily specified issues &amp;#8211; keep progressing &amp;#8211; as the specs are getting refined as well as work is being done on the issues &amp;#8211; so i can have a better idea of where the project will end up (in terms of time spent) than if i just look at the remaining (original) estimate.&lt;/p&gt;
&lt;p&gt;however, one can think of many other things to do here, eg. interpolate time entries to get another projected total time per issue / project, or calculate projected estimate for non-started tasks based on the original estimate and the precision of original estimates in the project (based on closed tasks). i have no need for that stuff right now, and no time to play with it just for fun (though would be interesting to see), maybe another time&amp;#8230; :)&lt;/p&gt;</description>
      <author>srejbi</author>
      <pubDate>Wed, 10 Feb 2010 11:47:41 +0000</pubDate>
      <link>http://srejbi.info/posts/2_get-time-estimates-from-redmine</link>
      <guid>http://srejbi.info/posts/2_get-time-estimates-from-redmine</guid>
    </item>
    <item>
      <title>The Cobbler's Children Have No Shoes</title>
      <description>&lt;p&gt;well, as you can guess, i am not a cobbler, actually&amp;#8230; just another busy software engineer that wonders every once in a while why his own website looks like crap /if there is a website at all :)/&amp;#8230;&lt;/p&gt;
&lt;p&gt;having my personal page up with &lt;a href=&quot;http://wordpress.org&quot;&gt;wordpress&lt;/a&gt; for some time now, i felt a little less pressure to do anything about it. however, doing plenty of rails stuff for some time now, started to wonder why i should keep running my site on wp and not just create something &lt;a href=&quot;http://en.wikipedia.org/wiki/KISS_principle&quot;&gt;simple and stupid&lt;/a&gt; in rails.&lt;/p&gt;
&lt;p&gt;so here it goes.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://dev.mobility.ws:4443/projects/show/yaqrb&quot;&gt;project page&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;this is free software, so feel free to grab it if you need something like this.&lt;/p&gt;
&lt;pre&gt;
git clone git://git.mobility.ws/yaqrb.git
&lt;/pre&gt;</description>
      <author>srejbi</author>
      <pubDate>Fri, 05 Feb 2010 22:59:11 +0000</pubDate>
      <link>http://srejbi.info/posts/1_the-cobbler-s-children-have-no-shoes</link>
      <guid>http://srejbi.info/posts/1_the-cobbler-s-children-have-no-shoes</guid>
    </item>
  </channel>
</rss>
