This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create rvmrc file | |
create_file ".rvmrc", "rvm 1.9.2" | |
gem "simple_form" | |
gem "devise" | |
gem "rake", "0.9.1" | |
run 'bundle install' | |
rake "db:create", :env => 'development' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/ssh' | |
module Backup | |
module Database | |
class SshBackup < Base | |
attr_accessor :name | |
attr_accessor :host | |
attr_accessor :username | |
attr_accessor :password | |
attr_accessor :host_username |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define in app controller | |
class ApplicationController < ActionController::Base | |
before_filter :require_login | |
# redirect somewhere that will eventually return back to here | |
def redirect_away(*params) | |
session[:original_uri] = request.request_uri | |
redirect_to(*params) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName blah.localhost | |
ServerAlias *.blah.localhost | |
DocumentRoot /var/www/blah/current/public | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated by NetworkManager | |
nameserver 127.0.0.1 # <--- ADD THIS | |
nameserver 8.8.4.4 | |
nameserver 8.8.8.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> sudo apt-get install dnsmasq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add domains which you want to force to an IP address here. | |
# The example below send any host in doubleclick.net to a local | |
# webserver. | |
address=/blah.localhost/127.0.0.1 | |
# Or which to listen on by address (remember to include 127.0.0.1 if | |
# you use this.) | |
listen-address=127.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> ApplicationController.allow_forgery_protection = false | |
> app.host! 'mysubdomain.mydomain.local:3000' | |
> app.post '/sessions', :username => 'phil', :password => 'somethingsecure' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rails c | |
> app.get '/uri' | |
> app.post '/uri', :postdata1 => "something", :postdata2 => "nothing" | |
> app.put '/uri', :postdata1 => "something", :postdata2 => "nothing" | |
> app.delete '/uri' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> app.get '/people' | |
> app.response.body | |
# You can also inspect the request with: | |
> app.request |