Skip to content

Instantly share code, notes, and snippets.

View jeevandongre's full-sized avatar
🎯
Focusing

jeevan dongre jeevandongre

🎯
Focusing
View GitHub Profile
@jeevandongre
jeevandongre / github-structure.markdown
Last active February 18, 2019 11:27
Github Structure
@jeevandongre
jeevandongre / import_csv.sql
Created September 29, 2015 08:44
Importing Data to mysql database from csv using stored procedures
LOAD DATA LOCAL INFILE 'file_name.csv'
INTO TABLE table_name
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;
@jeevandongre
jeevandongre / Deploy
Created September 25, 2015 10:49
Deploy resource chef
deploy_revision("new-spree-st") do
action [:deploy]
updated true
updated_by_last_action true
retries 0
default_guard_interpreter :default
deploy_to "/home/vagrant/apps/new-spree-st"
environment {"RAILS_ENV"=>"production"}
repository_cache "cached-copy"
symlink_before_migrate {"database.yml"=>"config/database.yml"}
@jeevandongre
jeevandongre / packages.sh
Created September 25, 2015 10:37
Script to install ruby 2.0.0-247 from the source on vagrant box with bundler gem. To be used with packer
#! /bin/bash -e
apt-get -y install build-essential zlib1g-dev libreadline-dev libssl-dev g++ bundler curl git htop nginx mysql-client libcurl3 libcurl3-gnutls libcurl4-openssl-dev liblzma-dev zlib1g-dev libmysqlclient-dev
sudo -u vagrant wget 'http://s3-ap-southeast-1.amazonaws.com/st-back-up/ruby-2.0.0-p247.tar.gz'
echo "Downloading ruby from s3..... \n Please wait ......"
sudo -u vagrant /bin/tar -zxvf ruby-2.0.0-p247.tar.gz
sudo chown vagrant:vagrant -R ruby-2.0.0-p247/
cd ruby-2.0.0-p247
sudo -u vagrant ./configure
sudo -u vagrant make
#!/bin/bash
sudo apt-get update --fix-missing
sudo apt-get upgrade openssl
openssl version -a
sudo apt-get update && sudo apt-get upgrade openssl && openssl version -b
@jeevandongre
jeevandongre / nginx.conf
Created August 26, 2013 09:29
Nginx.conf
worker_processes 2;
user ubuntu ubuntu; # for systems with "nobody" as a group instead
# Feel free to change all paths to suite your needs here, of course
pid /etc/nginx/nginx.pid;
error_log /var/log/nginx/nginx.error.log;
events {
worker_connections 1024; # increase if you have lots of clients
@jeevandongre
jeevandongre / unicorn_init.sh
Last active December 21, 2015 17:19
unicorn_init.sh
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage unicorn server
# Description: Start, stop, restart unicorn server for a specific application.
### END INIT INFO
@jeevandongre
jeevandongre / unicorn_ec2_ubuntu
Created April 5, 2013 11:48
Unicorn init.d script for ubuntu 12.04 ec2 instance
#! /bin/sh
PATH=/home/ubuntu/.rvm/gems/ree-1.8.7-2012.02/bin:/home/ubuntu/.rvm/gems/ree-1.8.7-2012.02@global/bin:/home/ubuntu/.rvm/rubies/ree-1.8.7-2012.02/bin:/home/ubuntu/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DAEMON=/home/ubuntu/.rvm/gems/ree-1.8.7-2012.02/bin/unicorn_rails
GEM_HOME=/home/ubuntu/.rvm/gems/ree-1.8.7-2012.02
GEM_PATH=ome/ubuntu/.rvm/gems/ree-1.8.7-2012.02:/home/ubuntu/.rvm/gems/ree-1.8.7-2012.02@global
DAEMON_OPTS="-D -c /path/to/app/config/unicorn.rb"
NAME=unicorn_rails