Ivan Tkalin

I’m a software engineer. I solve problems.

  • Installing Adobe Air and Elance Tracker on Ubuntu 13.10 (Saucy Salamander) 64 bit

    Update: Following instructions also work for Ubuntu 14.04 LTS Trusty Tahr 64 bit. After upgrading to Ubuntu 13.10 (Saucy) 64 bits, I had troubles installing Adobe Air and Elance Tracker air application. None of the guides available online worked for me. The guide that I used to install it on Ubuntu 13.04 didn’t work either. I would be happy not to use this piece of crap by Adobe, but, unfortunately, Elance doesn’t want to build native tracker application for Linux, and I need it for my freelance work.

    Read more…
  • Protecting staging/testing site area

    It seems, that the easiest way to protect staging/testing version of the (rails) application from search engines and undesired users is using HTTP Basic Authentication. Configuring it for nginx is very easy and well documented. First, enable HTTP Basic Authentication and specify passwords file location. To do this, add these lines to the site’s server config: auth_basic "Testing Zone"; auth_basic_user_file /var/www/my_app/current/shared/config/.htpasswd; Passwords file, specified in auth_basic_user_file directive, should store users and encrypted passwords in the following format:

    Read more…
  • Multiple file upload with Rails 3.2, paperclip, html5 and no javascript

    Today, I was looking for a simple multiple file upload solution for Ruby on Rails 3.2 with paperclip 3.0.4 and found several jQuery and Flash solutions, like Uploadify or jQuery-File-Upload, buy they seemed to be too heavy and complicated for my case. I didn’t need asynchronous upload and other features they provide, I only needed really simple (ideally pure html) solution to save several images for my Item model with regular form submit, but with possibility to select all images at once (in one input field).

    Read more…
  • Testing authorization using RSpec parametrized shared examples

    I have a rails app, that uses Devise for authentication and CanCan for authorization. There is a group of controllers in my application, that should be accessible by administrators only. I was thinking about a DRY way to test these resources and their accessibility by administrators only (using request specs with RSpec and Capybara). The idea is to have shared examples, which try to visit resource url as unauthenicated user, authenicated non-privileged user and administrator, and check if desired resource was loaded or not.

    Read more…
  • Using console vim as vim:// protocol handler in Ubuntu

    Do you want your browser to launch console vim and open specified file on specified line when you click link like this: vim:///etc/hosts&line=10? This article will show how to register console vim as vim:// protocol handler in Ubuntu 11.10. Just follow these steps: 1. Create vim launcher script We’ll need small vim launcher script, which will handle vim://... uri. As a ruby programmer I wrote this script in Ruby (so it requires Ruby to be installed), but it can be rewritten to Perl/Python or even Bash.

    Read more…