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
| module Termtter::Client | |
| # search replacement: | |
| # ADD: #[page] arg for list next pages | |
| register_command( | |
| :name => :search, :aliases => [:s], | |
| :exec_proc => lambda {|arg| | |
| search_option = config.search.option.empty? ? {} : config.search.option | |
| arg.gsub!(/\s*#(\d+)$/) { search_option[:page] = $1 ; ''} | |
| if arg.empty? && tags = public_storage[:hashtags] | |
| arg = tags.to_a.join(" ") |
| 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}' |
| # rails blog -m https://gist.github.com/1155984.txt | |
| # rails blog -m ~/template.rb | |
| # rake rails:template LOCATION=~/template.rb | |
| # template.rb | |
| run "rm public/index.html" | |
| generate(:scaffold, "person name:string") | |
| route "map.root :controller => 'people'" | |
| rake("db:migrate") | |
| git :init |
Authlogicは、簡潔で柔軟なRubyで記述された認証ソリューションです。
コードで例示して説明した方がいいでしょう…
Authlogicでは新しい型のモデルを提供しています。他のモデルのようにいくつでもどんな名前で必要なだけ作成することができます。この例では、クラス名から分かるようにUserモデルを使って認証を行おうとしています。
class UserSession < Authlogic::Session::Base # ここでは以下のように設定項目を記述します:
| # | |
| # 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 |