Copy your key to the server then SSH into it:
user@workstation ~$ scp .ssh/id_rsa.pub server:~/.ssh/authorized_keys
user@workstation ~$ ssh server
| require 'net/ssh' | |
| desc "Deploy site to production" | |
| task :deploy => :environment do | |
| host = 'yourhost.com' | |
| user = 'username' | |
| options = {:keys => '~/.ssh/keys/yourserver.pem'} | |
| remote_path = '/path/to/rails_app' | |
| commands = [ |
| require 'net/ssh' | |
| desc "Deploy site to production" | |
| task :deploy => :environment do | |
| host = 'yourhost.com' | |
| user = 'username' | |
| options = {:keys => '~/.ssh/keys/yourserver.pem'} | |
| remote_path = '/path/to/rails_app' | |
| commands = [ |
I have a project where I need translated content. Therefore I use globalize3, wich stores its translated attributes in a seperate table that belongs to the original model. And I use RailsAdmin for painless record management.
It took me some time to figure out how to get those working together, but eventually I found a solution that is non invasive and still ok to work with.
In my case there is a Snippet class. It holds content for static pages or text passages on the website. There is a good README for globalize3 for installation instructions and documentation.
| #!/bin/bash | |
| echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <URL1> <URL2> ..." | |
| echo -e "\nEx: benchmark.sh -n100 -c10 http://www.google.com/ http://www.bing.com/ \n" | |
| ## Gnuplot settings | |
| echo "set terminal png | |
| set output 'benchmark_${1}_${2}.png' | |
| set title 'Benchmark: ${1} ${2}' |
| # | |
| # Usage | |
| # | |
| # rails new yourapp -m https://raw.github.com/gist/1178242/3c77cfffeb99f32d19333de986ff41283aa9eb26/rails_template_for_3.1.rb -T --skip-bundle | |
| # | |
| git :init | |
| append_file '.gitignore', <<-END | |
| .rvmrc |
| namespace :myapp do | |
| desc 'Captures a heroku bundle and downloads it. The downloaded files are stored in backups/' | |
| task :backup do | |
| app_name = RAILS_ROOT.split('/').last | |
| timestamp = `date -u '+%Y-%m-%d-%H-%M'`.chomp | |
| bundle_name = "#{app_name}-#{timestamp}" | |
| puts "Capturing bundle #{bundle_name}..." | |
| `heroku bundles:capture --app #{app_name} '#{bundle_name}'` | |
| # poll for completion (warning, a little hacky) | |
| begin |
| virtualenv --no-site-packages . | |
| source bin/activate | |
| bin/pip install Django psycopg2 django-sentry | |
| bin/pip freeze > requirements.txt | |
| bin/django-admin.py startproject mysite | |
| cat >.gitignore <<EOF | |
| bin/ | |
| include/ | |
| lib/ | |
| EOF |