https://devcenter.heroku.com/articles/custom-domains http://thenomadicfreelancer.blogspot.com/2012/08/pointing-godaddy-domain-to-your-heroku.html
For each custom subdomain use domains:add in the Terminal.
| # install homebrew | |
| ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
| brew install git | |
| brew install node | |
| brew install wget | |
| brew install z | |
| brew install ag | |
| brew install ack | |
| brew install ffind |
https://devcenter.heroku.com/articles/custom-domains http://thenomadicfreelancer.blogspot.com/2012/08/pointing-godaddy-domain-to-your-heroku.html
For each custom subdomain use domains:add in the Terminal.
| # WEATHER INFO ------------------------------------------------------------ | |
| # Usage: | |
| # $ weather [CITY_NAME] | |
| # Examples: | |
| # $ weather #returns current local weather | |
| # $ weather "Porto Alegre" #returns Porto Alegre weather | |
| function weather { | |
| if [ -z "$1" ]; then | |
| curl http://wttr.in/; |
#Simple Authentication with Bcrypt
This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.
The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).
You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault
##Steps
| namespace :db do | |
| desc "Copy production database to local" | |
| task :copy_production => :environment do | |
| # Download latest dump | |
| system("wget -O tmp/latest.dump `heroku pg:backups public-url -q`") | |
| # get user and database name | |
| config = Rails.configuration.database_configuration["development"] | |
| database = config["database"] | |
| user = config["username"] |
i → Insert mode. Type ESC to return to Normal mode.
x → Delete the char under the cursor
:wq → Save and Quit (:w save, :q quit)
dd → Delete (and copy) the current line
p → Paste
| " ============================================================================= | |
| " Randson Oliveira .vimrc file | |
| " ----------------------------------------------------------------------------- | |
| " Heavily inspired by: @millermedeiros, @scrooloose, @nvie, @gf3, @bit-theory. | |
| " ----------------------------------------------------------------------------- | |
| " ----------------------------------------------------------------------------- | |
| " BEHAVIOR | |
| " ----------------------------------------------------------------------------- |
| FROM ruby:2.3.3 | |
| RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs | |
| RUN mkdir /app # app name | |
| WORKDIR /app | |
| ADD Gemfile /app/Gemfile | |
| ADD Gemfile.lock /app/Gemfile.lock |
| git filter-branch --env-filter ' | |
| WRONG_EMAIL="orandson@gmail.com" | |
| NEW_NAME="Randson" | |
| NEW_EMAIL="orandson@gmail.com" | |
| if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ] | |
| then | |
| export GIT_COMMITTER_NAME="$NEW_NAME" | |
| export GIT_COMMITTER_EMAIL="$NEW_EMAIL" | |
| fi |
| #!/bin/sh | |
| # Make sure to: | |
| # 1) Name this file `backup.sh` and place it in /home/ubuntu | |
| # 2) Run sudo apt-get install awscli to install the AWSCLI | |
| # 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
| # 4) Fill in DB host + name | |
| # 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
| # 6) Run chmod +x backup.sh | |
| # 7) Test it out via ./backup.sh |