Skip to content

Instantly share code, notes, and snippets.

View sathishmanohar's full-sized avatar

Sathish Manohar sathishmanohar

View GitHub Profile
@sathishmanohar
sathishmanohar / page.html.erb
Created January 20, 2016 13:31
Middleman sitemap.xml generator developed from https://gist.github.com/lukebowerman/3287848
---
sitemap_noindex: true
sitemap_priority: 0.8
---
@sathishmanohar
sathishmanohar / gist:87be77758fdc76c13950
Created October 16, 2015 22:16
Deploying Rails on Ubuntu 14.04 Gorails tutorial
* setup nameservers with domain provider
* create droplet in digital ocean
* create new deploy user
sudo adduser deploy (adding user deploy, enter password when prompted)
adduser deploy sudo (adding user to sudo group)
su deploy (switch to deploy user)
* logout
* add ssh key to deploy user
ssh-copy-id deploy@domain.com
Verifying that +sathish is my openname (Bitcoin username). https://onename.com/sathish
@sathishmanohar
sathishmanohar / deploy.rb
Created June 12, 2013 14:34
Capistrano Deploy Tasks
# Step 1: Add capistrano to Gemfile, then run `capify .`
# Step 2: create /public/assets directory locally
# Step 3: upload database.yml file to app_path/shared/config/database.yml on server
require 'bundler/capistrano'
require 'rvm/capistrano'
#server login details
set :application, "domain.com"
set :user, 'user'
@sathishmanohar
sathishmanohar / install_passenger_nginx_digital_ocean.sh
Last active June 2, 2020 12:30
Steps to setup and install passenger nginx and rails on digital ocean
# Login as root
ssh root@domain
# Create deploy user
adduser <username> #Adds User with username given. Enter Password when Prompted. Other Details are Optional
# Add user to sudo group
usermod -g <groupname> <username>
# Add .ssh/authorized_keys for deploy user
@sathishmanohar
sathishmanohar / .gitconfig
Last active December 16, 2015 11:18
General git aliases and some git-flow specific aliases
[user]
name = Sathish Manohar
email = design.sathish@gmail.com
[core]
editor = vim
[merge]
tool = vimdiff
[color]
ui = auto
[alias]
@sathishmanohar
sathishmanohar / reset_mysql_password.sh
Created April 19, 2013 11:07
Instructions to reset lost mysql root password on Ubuntu
#Stop Mysql
sudo /etc/init.d/mysql stop
#Start Mysql in safe mode, but skip user privileges table
sudo mysqld_safe --skip-grant-tables &
#Login to mysql
mysql -u root
#Select mysql db
@sathishmanohar
sathishmanohar / setup_devise.erb
Created November 17, 2012 10:12
Instructions to setup devise
# Add devise to Gemfile
gem 'devise'
# Run bundle
bundle install
# Run devise install
rails generate devise:install
# Make sure alert code in application.html.erb
@sathishmanohar
sathishmanohar / Gemfile.rb
Created October 13, 2012 14:02
Gemfile Skeleton for My Projects
source 'https://rubygems.org'
gem 'rails', '3.2.8'
gem 'bootstrap-sass', '2.0.4'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
gem 'jquery-rails', '2.0.2'
@sathishmanohar
sathishmanohar / rails_app_advanced_setup
Created October 13, 2012 13:44
Advanced Setup for New Rails App - Shamelessly copied from Michael Hartl
# Create Rails app and skip-bundle and Test Framework creation and specifiy database
rails new app_name -T -d mysql --skip-bundle
# Copy appropriate Gemfile
# Add necessary Gems to Gemfile then run `bundle install`
bundle install
# Then init Guard
bundle exec guard init rspec