Install with apt-get
$ sudo apt-get update
$ sudo apt-get install letsencrypt
$ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
| #!/user/bin/env ruby | |
| require 'bundler/inline' | |
| gemfile(true) do | |
| source 'https://rubygems.org' | |
| gem 'sinatra', '~> 1.4' | |
| gem 'bcrypt', '~> 3.1' | |
| end | |
| require 'sinatra/base' |
| // Contains support for: SASS/SCSS, concatenation, and minification for JS and CSS | |
| var gulp = require('gulp'); | |
| var sass = require('gulp-ruby-sass'); | |
| var concat = require('gulp-concat'); | |
| var compress = require('gulp-yuicompressor'); | |
| ### ssh to root in terminal with your server ip | |
| ssh root@123.123.123.123 | |
| ### Create new user | |
| adduser deploy | |
| ### Set new users privileges | |
| visudo | |
| ### Find user privileges section |
| #!/usr/bin/env bash | |
| install_elasticsearch() { | |
| echo " * -- Elasticsaerch -- *" | |
| echo " * Update" | |
| sudo apt-get -qq -y update | |
| echo " * Install JDK" | |
| sudo apt-get -qq -y install openjdk-7-jre-headless | |
| echo " * Download deb (V1.4.2)" |
| / Form excerpt | |
| = f.button t(".save"), class: "btn" | |
| = f.button t(".publish"), class: "btn", name: "publish" | |
| = f.button t(".test"), class: "btn", name: "test" |
| # app/models/image.rb | |
| class Image < ActiveRecord::Base | |
| has_many :taggings, :as => :taggable | |
| has_many :tags, :through => :taggings | |
| end |
There are 4 parts:
| # lib/tasks/db.rake | |
| namespace :db do | |
| desc "Dumps the database to db/APP_NAME.dump" | |
| task :dump => :environment do | |
| cmd = nil | |
| with_config do |app, host, db, user| | |
| cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
| end | |
| puts cmd |