Blog Archives

Doorkeeper (4.2.6) redirect URI does not match

 ERROR — omniauth: Authentication failure! invalid_credentials: OAuth2::Error, invalid_grant: The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client. add callback_url method in your oauth provider

Posted in Uncategorized

Invalid mix of scope block and deprecated finder options on ActiveRecord association

While upgrading from rails to rails 4.2.6 has_many :subitems, through: :child_associations, source: :child, source_type: ‘ContentItem’, conditions: ‘content_items.deleted 1’, order: ‘content_associations.position ASC’ Replaced conditions with proc has_many :subitems, ->{where(‘content_items.deleted 1’)}, through: :child_associations, source: :child, source_type: ‘ContentItem’,  order: ‘content_associations.position ASC’ 2.

Posted in Uncategorized, upgrade from rails 3 to 4

Heroku permission denied for database “postgres”

FATAL: permission denied for database “postgres” DETAIL: User does not have CONNECT privilege. Run this command to solve this error: heroku addons | grep POSTGRES

Tagged with: , ,
Posted in Heroku, Uncategorized

Install zsh on ubuntu with rvm/rbenv

Setup ZSH as your default terminal with oh-my-zsh Install ZSH sudo apt-get update && sudo apt-get install zsh ZSH tutorial pdf link Setup oh-my-zsh wget –no-check-certificate -O – | sh Make ZSH default chsh -s /bin/zsh Restart your system.

Posted in Uncategorized

Install Ruby on Rails in Ubuntu 14.04 LTS

Originally posted on Salayhin:
Here is step by step instruction on how to set up ruby on rails in ubuntu 14.04 LTS Installing Ruby using RVM: First you have  to install  some dependencies for Ruby. sudo apt-get update sudo apt-get…

Posted in Uncategorized

Different ways of Iterating over an Array in Ruby (Just for me)

Originally posted on Precious Info:
1) .each do |val| … end 2) .each_with_index do |val, index| … end 3) a) .map do … end  => returns new array b) .map.with_index do |val, index| … end 4) .any? do |val| {condition} end…

Posted in Uncategorized

Sql queries using ActiveRecord Rails without any model

ActiveRecord::Base.connection.execute(‘select * from schema_migrations’) 1. To verify open rails console by using command “rails console” 2. Then run above command. 3. It will return active record object containing data of specified table.

Posted in Uncategorized

Solving SSH error: Too many authentication failures for

Originally posted on My tech experiences:
You may encounter the following error when you try to remotely login to a machine using ssh. Received disconnect from 2: Too many authentication failures for username The reason behind this is that…

Posted in Uncategorized

MPD configuration [In progress]

In your home folder create vi .mpd.conf MPD_SECRETWORD=abc // write this line In your home folder create vi mpd.hosts add hostname list here like ws01 ws02 ws03 Copy “mpd.hosts” and “.mpd.conf” file to remote all servers by following command scp

Posted in Uncategorized

Connect to server using ssh and make password free enviornment

Connect to ssh server: $ ssh serverip -l username Enter user password: username@serverip’s password: change password command: $ passwd Password Free environment: Generate ssh-key: cd ~/.ssh ssh-keygen -t rsa append string in authorized_keys file[1]: ssh-copy-id -i ~/.ssh/ remote-host username@remote-host’s password:

Tagged with: ,
Posted in ssh, Ubuntu, Uncategorized