Rubymine and Ruby 1.9.x debugging – get it working

Sadly Rubymine still hasn’t resolved the debugger issue when trying to debug a Ruby 1.9.x application inside Rubymine.

It’s not hard to get the debugger up and running when you know how, there’s also a lot of chatter among the topic.

It boils down to the following steps:

  1. Download linecache19 0.5.13 and install it with
    gem install linecache19-0.5.13.gem
  2. Install the 1.9.x Ruby debug base (pre-release)
    gem install ruby-debug-base19x --pre
  3. Install the 1.9.x Ruby debug ide (also pre-release)
    gem install ruby-debug-ide19  --pre
  4. Start Rubymine and you're set!

Magnolia Conference 2012

The Magnolia Conference 2012 ended last wednesday – it was an overall great experience with a lot to take with and many interesting people and discussions. There is also a small blog post about it in my company’s blog.

I’m impressed with the big steps forward Magnolia takes with the new Magnolia 5 Release and its completely new Vaadin-based administration backend.

Really looking forward to the first project with it!

Secure your staging environments with capistrano and .htaccess

Are you using capistrano to deploy your application to multiple environments?
Are you using a public staging system but like to easily control access via .htacces file?
Then this might interest you.

A little bit more context information.
I have a project with two deploy environments configured using capistrano, staging and production.
The staging environment is used for client testing before the product gets released onto the production environment.
We’re hosting our staging and production environments using a 3rd party hosting provider.
Both environments are publicly accessible but – of course – the client demands restricted access on the staging environment.

Theres quite an easy way to automate .htaccess protection using capistrano.

First, add the following two tasks to your deploy.rb script:

This website provides an easy and convenient tool to generate the .htpasswd file. Use it to generate your password and replace the [USER]:[ENC_PASSWD] string above with the correct output.

Done! You’re now able to protect and unprotect a deploy environment with the following two capistrano tasks:

cap deploy:protect
cap deploy:unprotect

Git 2 git migration script

Here’s a small ruby script I wrote to help me facilitate an upcoming git to git migration.
It takes two params, first the name of the repository to be migrated, second the name of the new remote repository.
The script is simple and straightforward, it clones the remote repository to the current directory, fetches all branches, creates a new mirror, pushes all branches and pushes all tags – done.
Feel free to use and further improve it…
Note: The new remote repository must already exist (bare).

Brakeman – Rails security analytics tool

Brakeman is a nice tool for static security analysis of RoR applications. It should help you discover security flaws in your applications like possible SQL injections, mass assignment problems and so on…

Simply install the gem using

gem install brakeman

and run it with a nice html output inside your rails project directory:

brakeman -o brakeman.html

The html output provides a nicely formatted frontend with summary and detail reports concerning the tests done and possible security flaws. It even displays the correspondent source code lines.

Although it doesn't give you complete safety, it's a good start for finding some potential security holes. Definitively a tool worth trying.