start new:
tmux
start new with session name:
tmux new -s myname
module God | |
module Conditions | |
class RestartFileTouched < PollCondition | |
attr_accessor :restart_file | |
def initialize | |
super | |
end | |
def process_start_time | |
Time.parse(`ps -o lstart -p #{self.watch.pid} --no-heading`) |
require 'yaml' | |
require 'logger' | |
require 'active_record' | |
namespace :db do | |
def create_database config | |
options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'} | |
create_db = lambda do |config| | |
ActiveRecord::Base.establish_connection config.merge('database' => nil) |
require 'rack' | |
require 'rack/proxy' #gem install rack-proxy | |
class Proxy < Rack::Proxy | |
def rewrite_env(env) | |
env["HTTP_HOST"] = "my.host.com" | |
env["SERVER_PORT"] = "80" | |
env | |
end | |
end |
#require 'orm_adapter/adapters/mongo_mapper' | |
module Devise | |
module Orm | |
module ParseResource | |
extend ActiveSupport::Concern | |
included do | |
extend Devise::Models | |
extend Devise::Orm::ParseResource::Hook |
web: bundle exec $APP |
### blogged @ http://dojo4.com/blog/easy-cheasy-realtime-log-tailing-in-a-rails-admin-view | |
### the su controller action | |
def logs | |
log = File.join(Rails.root, "log", "#{ Rails.env }.log") | |
@lines = `tail -1024 #{ log }`.split(/\n/).reverse |
--colour | |
-I app |
In the seemlingly endless search for the actual correct and easy way to deploy a Rails app, we have tried several ways. We tried out using Apache2 and running a cluster of Thin servers. With the built in threading of Puma we decided to use it with Nginx.