start new:
tmux
start new with session name:
tmux new -s myname
| # ~/Gemfile | |
| source "http://rubygems.org" | |
| group :development do | |
| # CSS Preprocessing | |
| gem 'sass' | |
| gem 'compass' | |
| gem 'jekyll' |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
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
| #!/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 |