Monday, November 7, 2016

Disabling double tap zoom on android web browsers,without viewport

Wednesday, August 24, 2016

resizing image with ImageMagick and Rails models

has_attached_file :image,
storage: :s3,
bucket: ENV['AWS_S3_BUCKET_NAME'],
styles: { thumb_filled: '345x345', thumb: '345x345\>' },
default_url: '/images/missing_breed.png',
convert_options: { thumb_filled: " -background 'rgb(245, 249, 252)' -gravity center -extent 345x345 " }

Tuesday, July 12, 2016

Monday, June 13, 2016

Elastic Beanstalk - RAILS - REDIS - SIDEKIQ


the only change in config files if you are using ubuntu

files:
  "/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq":
    mode: "000755"
    content: |
      #!/bin/bash
      cd /var/app/current
      if [ -f /var/app/support/pids/sidekiq.pid ]
      then
        kill -TERM `cat /var/app/support/pids/sidekiq.pid`
        rm -rf /var/app/support/pids/sidekiq.pid
      fi
      . /opt/elasticbeanstalk/support/envvars.d/sysenv
      sleep 10

      bundle exec sidekiq \
        -e production \
        -P ~/sidekiq.pid \
        -C /var/app/current/config/sidekiq.yml \
        -L ~/sidekiq.log \
        -d
  "/opt/elasticbeanstalk/hooks/appdeploy/pre/03_mute_sidekiq":
    mode: "000755"
    content: |
      #!/bin/bash
      if [ -f /var/app/support/pids/sidekiq.pid ]
      then
        kill -USR1 `cat /var/app/support/pids/sidekiq.pid`
      fi
  "/opt/elasticbeanstalk/support/conf/sidekiq.conf":
    mode: "000644"
    content: |
      description "Elastic Beanstalk Sidekiq Upstart Manager"
      cd /var/app/current
      ln -sf /var/app/current/log/sidekiq.log /var/app/containerfiles/logs/sidekiq.log
      if [ -f /var/app/support/pids/sidekiq.pid ]
      then
        kill -TERM `cat /var/app/support/pids/sidekiq.pid`
        rm -rf /var/app/support/pids/sidekiq.pid
      fi
      . /opt/elasticbeanstalk/support/envvars.d/sysenv
      sleep 10

      bundle exec sidekiq \
        -e production \
        -P ~/sidekiq.pid \
        -C /var/app/current/config/sidekiq.yml \
        -L ~/sidekiq.log \
        -d

files:
  "/etc/init/sidekiq.conf":
    mode: "120400"
    content: "/opt/elasticbeanstalk/support/conf/sidekiq.conf"
commands:
  reload_initctl_for_sidekiq:
    command: "sudo initctl reload-configuration"


Regards,
Pavan

Friday, June 10, 2016

Elastic Beastalk RAILS - Bower - Big mess

I have been trying to deploy app using EBS, but was not able to
install bower some how, here is the work around I took:

1. remove package.json and node_modules.

2. npm install -g bower (You may need to add sudo)

3. then run rake bower:install

DATABSE:

https://medium.com/@jatescher/how-to-set-up-a-rails-4-2-app-on-aws-with-elastic-beanstalk-and-postgresql-3f9f29c046e2#.fm82tpmb5

Workers : Crons

https://medium.com/@joelennon/running-cron-jobs-on-amazon-web-services-aws-elastic-beanstalk-a41d91d1c571#.j9s8mw7rd


REF: http://sebastien.saunier.me/blog/2015/10/20/aws-elastic-beanstalk-commands-for-rails.html

Regards,
Pavan