Resolve 404 error in wordpress post enabling Permalinks

There are numerous posts on  errors encountered post enabling permalinks , especially  when wordpress is in a subdirectory.   Please add following code in your main virtualhost  to fix this up. Use of .htaccess is not recommended if you are

Good practices to follow in Ruby on Rails

Typically, when we  wish to loop with a ruby Activerecord object, we follow something like below :   class CommentsController < ApplicationController def users_comments posts = Post.all comments = @user_comments = do |comment| == params[:username] end end

Add new EBS volume for EC2

Stop the instance. Create a snapshot of the root EBS volume. Create an ESB volume from that snapshot with the new desired size. (Please ensure it is in the same AZ as the instance) Detach the root EBS volume and

Postgresql setup + access management + permission managent

provide permissions to a table and a sequence : GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO myuser; GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO myuser;

Random linux commands

We will, keep updating commands  specific to  rhel/ centos/ debian distributions     Yum search’*search*’ yum install/reinstall/remove package yum list ‘*search*’ yum provides */ where  *.so.4 is the file name we wish to search  to be found in package

Import / Export pgsql db in Heroku

 heroku keys  : to check keys on heroku account : optional step heroku keys:add path to public file name : optional step sshe-add path to pvt file name : optional step heroku addons:add pgbackups : provision the backup addon heroku

How t to manage multiple ssh-keys and connect them to servers

Create a file called ~/.ssh/config SSH will look for the user’s ~/.ssh/config file. I have mine setup as: Host gitserv Hostname IdentityFile ~/.ssh/id_rsa.github IdentitiesOnly yes # see NOTES below Above can be used for both cloning/pushing git repository and logging

How to add multiple key based login info for ssh

Please make a file  named ~/.ssh/config Add following content for each ssh login entry you wish to have/connect to with its relevant pvt key path # tracerr Host # host  to connect to User root # user with which

Date Time Formats in Ruby

strftime( string ) method of the ‘Date’ class can use for that purpose..   eg – t = t.strftime(“%m/%d/%Y”) #=> “19/09/2009” t.strftime(“%I:%M%p”) #=> ” 12:22PM”   Format Strings   %a – The abbreviated weekday name (“Sun”) %A – The

send_data vs send_file in Rails

send_data: ———— send_data, Sends the given data to the browser. This method allows you to specify if the browser should display the response as a file attachment i.e. in a download or as inline data i.e; showing the output on