How Secured is your Rails App?

Cats: General| No Comments »

What do you prefer in terms of Authentication?

Plugin - Restful Authentication (recommended) - easy to use and you can tweak it according to your requirements.

Build your own authentication. You should rarely need to do this … Restful Authentication is quite flexible.

OpenID - a universal authentication system to avoid use of multiple username and password on the Internet. OpenID is getting quite famous now-a-days.

Access Control : To easily proivde different priviliges to your users. There are a lot of cool plugins available for access control.

Centralized Authentication Server - is used to implement single login/password for your users across multiple application. It can also be used for a single sign-on system. For example, Gmail and Google Reader have a single sign-on between them.

Use Google Authentication API to let your users login using their google username and password.

More Plugins :

Read the rest of this entry »

Ubuntu 9.10 running in low-graphics mode

Cats: General| 6 Comments »

After the installation from update manager, and every time I boot up my machine, I get a error with three options out of which I am forced to click OK for “Run Ubuntu in low-graphics mode for just one session” option.

Resolution upon reference from url (http://ubuntuforums.org/archive/index.php/t-1242813.html) for Ubuntu 9.10:

Take a backup and edit xorg.conf file:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_bkp
sudo gedit /etc/X11/xorg.conf

Delete this Section Device:

Section “Device”
Identifier     “Device0″
Driver         “nvidia”
VendorName     “NVIDIA Corporation”
BoardName      “GeForce 8400M GS”
EndSection

And Edit the Section Screen as:

Section “Screen”
Identifier     “Screen0″
Device         “Device0″
Monitor        “Monitor0″
DefaultDepth    24
SubSection     “Display”
Depth       24
Modes “1440×990″
EndSubSection
EndSection

Here we go, no more low graphics mode issues.

Windows 7 and ROXIO

Cats: General| 1 Comment »

I recently got my XPS M1330 notebook upgraded from Windows Vista to Windows 7.It happened that one day I need to burn a CD and found that ROXIO DVD Creator is no more working though I have used it less. I have found the collection of CDs given by Dell and re-installed ROXIO Creator 9.  Thats it ! I made my own Axe on neck. Everytime I boot up my notebook. a pop up near the windows toolbar stating “This driver has got compaitibity issues with windows blah… blah…” and then the following errors appear:Microsoft Visual C++ Runtime LibraryRuntime Error!Program:…ommon Files\RoxioShare\9.0\SharedCom\(application).exeThe application has requested the Runtime to terminate it in an unusual way.Please contact the applications support team for more information - OR - Microsoft Visual C++ Runtime LibraryRuntime Error!Program: C:\Program Files\Roxio\(application folder)\(application name).exeR6025- pure virtual functional call I should say its more than a nightmare. This error keep popping up by freezing my notebook every 10-15 minutes approx. I tried all my ways of uninstalling it by following this support url of ROXIO.http://kb.roxio.com/search.aspx?URL=/content/kb/Creator/000127CR&PARAMS=But No Go !The error continued  for several Days..  Irritated and frustrated, today i just sat for hours to fix it. Finally I did it. Took almost 6 hours to google it and fix it though.I am blogging it to help another “Sufferer” of Roxio.Step 1:  I have got ROXIO installed as many Programs infact using the Roxio Creator 9 CD given by Dell.

  • “Roxio Audio”
  • “Roxio MyDVD”
  • “Roxio Drag and Disc” etc.. with update manager included.

Step 2: Instead of uninstalling the programs through Control Panel remove programs. Uninstall themFrom Program Files -> roxio XXX -> UninstallFollow this support url ->   http://kb.roxio.com/search.aspx?URL=/content/kb/Creator/000127CR&PARAMS= Step 3: I did everything but I couldnt delete Program Files -> Commom Files -> Roxio Shared/Sonic Shared.It says that it is used by some other application. Those are nothing but# RoxWatchTray9.exe# RoxMediaDB9.exe# VideoWave9.exe# MyDVD9.exe# MediaManager9.exe# DiscCopier9.exe# RXLabelCreator.exeStep 4:  I opened Task Manager in Windows 7 , it didn’t showed me any of these processes running. Here lies the main story. Due to which I couldnt delete the Roxio Shared under common files folder which is the root cause of Runtime error Popping up now and then.I even ran to buy Perfect uninstaller Software by reading this :http://www.squidoo.com/uninstallroxioI used that software and got ROXIO uninstalled though.Later I found “Show all process from all users” tab under Task Manager wherein you can end that process of roxioxxx.exe running and easily delete that Roxio shared folder under common files.Great ! those Perfect uninstaller people are earning on Roxio. Kudos to them! Kicks to roxio! and Sorries for other Users (like me)! But dont worry, just try the above steps.

Rails 2.3.3 Released

Cats: Ruby on Rails| No Comments »

new release of Rails is available - Rails 2.3.3.Among the usual bug fixes, a few new features were added, from the release notes:

  • touch is a convenient method to update a record’s timestamp and nothing else. This is extracted from apps whose models “touch‚” others when they change, such as a comment updating the parent.replies_changed_at timestamp after save and destroy.[..]
  • :primary_key option for belongs_to for broader support of legacy schemas and those using a separate UUID primary key: belongs_to :employee, :primary_key => ‘SSN’, :foreign_key => ‘EMPID’ [..]
  • leaner user-facing encoding [JSON] API.
  • decoding backends for the json and yajl libraries. Both are significantly faster than the default YAML backend.

Meanwhile, the work on Rails 3 continues. Yehuda Katz has posted a few blog entries on the new architecture for Rails 3, as well as lessons learned from refactoring a large code base as Rails.One of the goals of Rails 3 is to bring Merb’s modularity and well defined internal APIs to the Rails codebase; Yehuda’s article on the interface between ActionController and ActionView gives some insight in what’s going on on that front. What becomes clear is that the fusion of Merb and Rails is a major project and is still underway.The work on Rails 3 also has an impact on the development of Merb. A recent discussion on the Merb mailing list addressed the state of Merb 1.1, which was due a few months ago. The current plan is to make sure a smooth migration path to Rails 3 is possible - which, of course, requires to know what Rails 3 architecture will be.With all that said, Merb is still a viable solution for many projects, as Ezra Zygmuntowicz (Merb’s creator) points out:

I’d like to chime in and say that I am still happily building apps with merb, http://engineyard.com/solo is built on merb. I don’t find that there is anything I’m missing or that there are any features or major bugs stopping me from building apps with merb.

For another glimpse at plans for Rails 3, David Heinemeier Hansson’s RailsConf’09 talk is available online.

 

Driver Error: Svn Merge

Cats: Ruby on Rails, Technology| No Comments »

The ’svn merge’ command compares two trees, generates a patch, then
applies that patch to a working copy. Yes, you have complete freedom
to compare any two trees, and thereby generate any patch you want. But
that does *not* mean that ’svn merge’ always will do what you want.
It’s *your* responsbility to make sure that the patch being produced
makes sense, and cleanly applies to your working copy.      
Skipped ’src’
Skipped ’src’
Skipped ’src\au’
Skipped ’src\au\com’
Skipped ’src\au\com\forward’
Skipped ’src\au\com\forward\codeSections’
A src\au\com\forward\codeSections\DesignNotes.txt
A src\au\com\forward\codeSections\CodeSections.java
Skipped ’src\au\com\forward\codeSections\testFiles’
A src\au\com\forward\codeSections\testFiles\testin.cs
Skipped ‘docs’
Skipped ‘docs’
A docs\htmldoc.exe 

See those skipped messages? That indicates driver error. The merge
command is trying to add and remove certain directories because they’re
not related to each other at all. Please read this section of chapter
4, regarding ancestry:

http://svnbook.red-bean.com/en/1.1/ch04s03.html#svn-ch-4-sect-3.2.4

Then after reverting, try the merge again with the –ignore-ancestry
command.

So, It is like this what I have implemented,

> Taken a latest production copy as my_working_copy

> Merged the dev branch with production branch under  my_working_copy

svn merge –ignore-ancestry prod_branch_url dev_branch_url my_working_copy/

> And this is how we avoid the driver error.

> Check for conflicts under my_working_copy

Fix the conflicts always in favour of Clients Requirements.

Else if no conflicts, check in the merge to production

Finally, Say The END to the project !!!

Next is What ?  [ Samsung Adv :) ]

Avoid SVN updates for External Rails Plugins in your Application

Cats: General| No Comments »

Make sure you are in the root of your app and do:
svn propedit svn:externals vendor/plugins
Just delete the line(s) of the plugins you no longer want.

If you get the following error then you need to set your environment variable.
svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set, and no ‘editor-cmd’ run-time configuration option was found

For example, you can set the SVN_EDITOR to use Vi editor from your unix prompt like

export SVN_EDITOR=’”/bin/vi”‘

In Windows, instead of export, it is

set SVN_EDITOR=c:/windows/notepad.exe (for notepad)

or

set SVN_EDITOR=”C:\Program Files\Posix Tools\bin\vi” (for Vi editor)

I need an individual file to be migrated in Rails

Cats: Ruby on Rails| No Comments »

Rails migrations are great, they allow continual evolution of database schema. Sometimes, especially when prototyping, I hate to run migrations down and up and load data, just to make small independent change in database table. In this situations I run only specific migration:

ruby script/runner 'require "db/migrate/005_create_blogs"; \n
CreateBlogs.migrate(:down)'
ruby script/runner 'require "db/migrate/005_create_blogs";\n
 CreateBlogs.migrate(:up)'

This is much typing (for just one migration at least ;) so here is the rake task to do the same:

namespace :db do
  task :migrate_one => :environment do
    file = Dir["db/migrate/#{ENV["VERSION"]}_*.rb"].first
    require(file)
    migration_class = file.scan(
/([0-9]+)_([_a-z0-9]*).rb/)[0][1].camelize.constantize
    migration_class.migrate(:down) unless ENV["DIRECTION"] == 'up'
    migration_class.migrate(:up) unless ENV["DIRECTION"] == 'down'
  end
end

Put this rake task in lib/tasks and you can call it with rake db:migrate_one VERSION=005. This would run migration down and up. You can also add DIRECTION=up or DIRECTION=down to control direction.

Thanks to Bojan Mihelac.

Enni Gundelu aaa?

Cats: General| No Comments »

“Enni Gundelu aaa?” Its a normal saying in telugu asking How dare you? But the exact words translation is “How many hearts you have haan?” Hmm… Well… I have two hearts !!!

Weird, Rare… and what not !

Cats: General| 2 Comments »

Apart from Redhat Linux, I’m also trying to set up my Rails app on a Win XP Pro machine to clarify some Ajax effects in IE. IE used system hosts file very well. But at the same time, on the same OS,  my latest Mozilla Firefox version 3.0.1 ignores the same hosts file. And this only happens when Proxy Server is used.

I didn’t understand why the configuration works only with IE, but not with
Mozilla. Makes no sense to me at all.

I am sure that I have set no proxy for localhost, and I have even tried setting no proxy for the local IP range like 192.168.3.0/24 where my working IP lies in between. Glory ! it worked…!!!

Ofcourse, I googled with suggestions of clearing cache and subscription to 5$ monthly plan to know the solution. So this info.. is for those who uses proxy and gets weird cases like this… Enjoy the solution,  absolutely free…! :)

Ubuntu + ROR + Mysql + Svn +VPN

Cats: Ruby on Rails, Ubuntu| 1 Comment »

Every time we install Ruby/Rails/Mysql/Rmagick/Vpn on Ubuntu Gutsy or Hardy we face the same  errors again and again. Lets reduce the installation time and have a loop-back-fix-free or smooth installation experience.

After you run the CD or install Ubuntu, make sure of your Network Proxies if any, if so, you need to add the proxy url at System->preferences->Network Proxy.

then from terminal, make sure this passes…

sudo apt-get update

then for Mysql/Rails installation follow this:

http://articles.slicehost.com/2007/11/23/ubuntu-gutsy-mysql-and-ror

and for VPN installation/connection on Ubuntu, this is the best guide:

http://www.cs.umn.edu/help/offsite/vpn.php#ubuntu_config

The Hidden Treasure

Cats: General| No Comments »

 All thats nice, sweet and makes one happy is a treasure. And if anything of that sort is hidden is called the Hidden Treasure I mean… what you say?

Well, I am talking about “My fav. singer” and thats the talent of my best buddy thats hidden..

JRuby on Rails in Glassfish V3

Cats: JRuby on Rails| No Comments »

Yesterday it happened to come across an article on ”Mingle: A Rails based enterprise product” by Thoughtworks Studio.

They have used Jruby on Rails for many reasons, which made me even more curious to browse around and know on it more and more but comprises three main points…

>  Invoking Java code from Ruby

>  Or Java libraries can be used with Ruby syntax

> Deploy Rails apps on Java app servers via WAR files

(thereby the rails app can be your desktop application avoiding to create a seperate desktop app) 

The idea is seriously damn cool…

Common Query: What does Engineering doing in Software Engineering?

Cats: Software Engineering| No Comments »

Writing code or set of programs result into ”Software products” that are generic or customized according to the customer specifications. Now whats this Engineering doing out here? This is a quite common query…

Engineering in general terms mean “The application of Science to the design, building and use of  machines, constructions etc.”

Composing the both… the definition of Software Engineering results into

“The art,craft and science of building large and important software systems. It is an amalgam of artistry, craftsmanship and scientific thought”

SE

Process Tool

Cats: Software Engineering| No Comments »

The reason why the projects are categorized into large, medium, small, and very small is that they need to follow different processes for development.  

  Small and Very Small projects should follow only Waterfall Model, whereas Medium size projects follow either Waterfall or Iterative model. Lastly, Large projects follow either Waterfall or Iterative or Incremental model.

Therefore a large project and a very small project cannot follow the same steps while executing deliveries.    To keep a large project on track, one needs to have substantial processes in place, whereas having few processes leads to the risk of unmanaged processes, which may lead to failure.    Whereas, for a small project, having a huge process makes it a tedious and unnecessary overhead.     

Process

Install IE6 on Ubuntu

Cats: Ubuntu| No Comments »

Many of them would be knowing this before… But thanks to the reference site which am able to do the same…

http://www.ubuntugeek.com/running-internet-explorer-in-ubuntu-linux.html

IEs4Linux is the simpler way to have Microsoft Internet Explorer running on Linux (or any OS running Wine).

No clicks needed. No boring setup processes. No Wine complications. Just one easy script and you’ll get three IE versions to test your Sites. And it’s free and open source.This may be very helpful for software developers and web developers to test their applications.

IEs4Linux Installation in Ubuntu

You have to enable universe packages first. It is also recommended that you use the official winehq ubuntu package:

Open /etc/apt/sources.list file

sudo gedit /etc/apt/sources.list

Uncomment following lines in your /etc/apt/sources.list and it may be different if you are in different country instead of UK

For Ubuntu Dapper Users

deb http://uk.archive.ubuntu.com/ubuntu dapper universe
deb-src http://uk.archive.ubuntu.com/ubuntu dapper universe

For Ubuntu Edgy Eft Users

deb http://uk.archive.ubuntu.com/ubuntu edgy universe
deb-src http://uk.archive.ubuntu.com/ubuntu edgy universe

Add WineHQ APT Repository

or

If you want to add source packages from the repository

Currently, wine only have i386 binary packages available. If you do not use an i386 architecture, or wish to compile the package in a special or optimized way, you can build the wine package using the source repository instead. To do this, add a source repository with one of the following:

For Ubuntu Dapper Users

deb http://wine.budgetdedicated.com/apt dapper main
deb-src http://wine.budgetdedicated.com/apt dapper main

For Ubuntu Edgy Eft Users

deb http://wine.budgetdedicated.com/apt edgy main
deb-src http://wine.budgetdedicated.com/apt edgy main

Close gedit and run an update to take your new Repository

sudo apt-get update

Install wine and cabextract

sudo apt-get install wine cabextract

Now you need to download IEs4Linux script from here

wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-2.0.5.tar.gz

tar xzvf ies4linux-2.0.5.tar.gz

cd ies4linux-2.0.5

Once you are inside ies4linux-2.0.5 directory you need to run the following script to install internet explorer

./ies4linux

This will install the internet explore in your machine.

To run IE you need to run the following command and it may be different for others this path at the end of installation it will give from where you want to run

/root/bin/ie6

You should see the Internet explorer opening

If try to run /root/bin/ie6 as root user you will get the following error messages so you need to run as user#/root/bin/ie6
fixme:actctx:CreateActCtxW stub!
err:imagelist:ImageList_ReplaceIcon no color!
err:imagelist:ImageList_ReplaceIcon no color!
err:imagelist:ImageList_ReplaceIcon no color!
err:imagelist:ImageList_ReplaceIcon no color!
Application tries to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.

If you want to check more information about this script check here