instance_id = `ec2-metadata --instance-id | sed 's/instance-id: //'`.chomp
https://github.com/defunkt/unicorn/blob/422a657a5f6dfb69f44feabd6429f2904ca03fa8/Sandbox#L48-L55
before_exec do |server|
ENV["BUNDLE_GEMFILE"] = "/var/www/html/my_application/Gemfile"
end
- Develop and Debug Atom Package
apm develop <package-name>
atom -d .
- Reload:
- alt + cmd + ctrl + L
- Debugging console:
- alt + cmd + I
We have Doctor
and User
model.
We also have DoctorsUsers
model to represent with the relationship
between those two models.
This file contains hidden or 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
# Returns rake routes like formatted string. | |
def get_formatted_routes_data(routes) | |
inspector = ActionDispatch::Routing::RoutesInspector.new(all_routes) | |
inspector.format(ActionDispatch::Routing::ConsoleFormatter.new, nil) | |
end | |
all_routes = Rails.application.routes.routes | |
data = get_formatted_routes(all_routes) | |
list = data.split("\n") |
This file contains hidden or 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 'aws-sdk' | |
TERMINAL_CODES = %w( | |
request-canceled-and-instance-running | |
marked-for-termination | |
instance-terminated-by-price | |
instance-terminated-by-user | |
instance-terminated-no-capacity | |
instance-terminated-capacity-oversubscribed | |
instance-terminated-launch-group-constraint |
This file contains hidden or 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 'sshkit' | |
require 'sshkit/dsl' | |
HOST = '' # 'foo.domain' | |
USER = '' # 'ec2-user' | |
KEYS = [''] # '~/.ssh/id_rsa' | |
hoge = "hoge" | |
command = SSHKit::Command.new <<-EOF | |
echo # Need to place bare "echo". |
NewerOlder