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 = posts.map(&:comments).flatten @user_comments = comments.select do |comment| comment.author.username == 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 */libcrypto.so.4 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 remote.server.com IdentityFile ~/.ssh/id_rsa.github IdentitiesOnly yes # see NOTES below Above can be used for both cloning/pushing git repository and logging

Setup automatic subdomains on your local linux based computer

Lets say we have to setup idify.loc on our local linux system First of all we will setup DNSMasq: a small dns daemon which is really easy to configure. This’ll be used for wildcard subdomain domain names. sudo apt-get install dnsmasq

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 162.243.46.106 # host  to connect to User root # user with which

Save images to flickr using flickraw gem

Login to your Flickr account. Then create an app in the Flickr App Garden by going to the following link: https://www.flickr.com/services/apps/create/ All the apps in the App Garden are created by Flickr members using the Flickr API. Here’s how: –