Monitor Delayed Job in rails

>Delayed Job & Monit configuration We were struggling through how to monit delayed_job from past few months because monit doesn't work seamlessly with delayed_job start/stop commands and finally we got able to monit delayed_job. Here is our old configuration that wasn't working anyhow- After doing google & looking at stackoverflow, we found different solutions to … Continue reading Monitor Delayed Job in rails

Getting started with rails 3 & postgres database

>Rails 3 Installationsudo gem install rails -v3.0.4postgres as db installationbr/$ sudo apt-get install postgresqlRails 3 App with postgres as database$ rails new pg -d postgresbundle installationIt will install dependency gems & postgres adapter for db connectionbundle installHere by default 'postgres' database user gets created while installation but i recommend to create new db user with … Continue reading Getting started with rails 3 & postgres database

Auto login remote server by copying ssh public key to authorized keys

>While working on remote machine we often get headache of entering password for ssh login, scp files from one server to another server. Adding public key as authorized_keys on remote server solves this problem. Copying from my system to remote server cat ~/.ssh/id_rsa.pub | ssh sandip@server 'cat >> ~/.ssh/authorized_keys'Copying from remote server to my system … Continue reading Auto login remote server by copying ssh public key to authorized keys

Installing and running cronjob (crontab basics)

>Basic commands to open/Edit crontab fileEditing crontab filecrontab -eDisplaying crontab filecrontab -lRemove crontabcrontab -rcrontab syntaxcron command basically takes 6 input parameters of which each input can take multiple argumentsfor that one can make use of comma or pipe separator# min hour dom mon dow command* * * * * (command)Here * means for every. Above … Continue reading Installing and running cronjob (crontab basics)

Testing restful & polymorphic resource routes on rails console

>Testing restful & polymorphic resource routes on rails consoleOpen rails consolerails c # In rails 3ORruby script/consoleapp object of URL>> app=> #<ActionController::Integration::Session:0xc164fac @result=nil, @status=nil, @accept="text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", @path=nil, @request_count=0, @application=#<ActionController::Dispatcher:0xc1644f8 @output=#<IO:0x85e34ec>>, @remote_addr="127.0.0.1", @host="www.example.com", @controller=nil, @https=false, @request=nil, @headers=nil, @cookies={}, @status_message=nil, @named_routes_configured=true, @response=nil>Root URL>> app.root_url=> "http://www.example.com/"Plural paths>> app.calls_path=> "/calls"Singular routes>> app.audio_call_pathActionController::RoutingError: audio_call_url failed  >> app.audio_call_path(1)=> "/calls/1/audio">> app.audio_call_path(13)=> "/calls/13/audio">> app.audio_call_path(13, … Continue reading Testing restful & polymorphic resource routes on rails console