- knife the server once
- log in with generic ubuntu once
- fix encrypted dbag value
- ensure edbs is at /etc/chef/encrypted_data_bag_secret has the correct key (get from dreamr)
| reporter = Reporting::Reporter.new | |
| def do_shit | |
| reporter.add_msg_line "Starting do shit" | |
| rescue Exception => e | |
| reporter.add_msg_line "There was an error! #{e.message}" | |
| ensure | |
| reporter.send_event("do Shit") | |
| end |
| (ruby-1.9.3) ~/proj/hvst/infrastructure $ knife ec2 server create -r 'role[base], role[app--rails]' -I ami-daac32ea -f m1.medium -G hvst-base -x ubuntu -Z us-west-2b -N app02.hvst.com | |
| Instance ID: i-295ba41e | |
| Flavor: m1.medium | |
| Image: ami-daac32ea | |
| Region: us-west-2 | |
| Availability Zone: us-west-2b | |
| Security Groups: hvst-base | |
| Tags: {"Name"=>"app02.hvst.com"} | |
| SSH Key: staginghvstcom |
| how do I get from here (app01) | |
| (ruby-1.9.3) ~/proj/hvst/infrastructure $ knife node show app01.hvst.com | |
| Node Name: app01.hvst.com | |
| Environment: _default | |
| FQDN: app01.hvst.com | |
| IP: 54.218.202.46 | |
| Run List: role[base], role[app--rails] | |
| Roles: base, internal--shell, internal--logs, internal--security, internal--mailer, internal--monitoring, internal--datadog, internal--system_tools, app--rails, internal--development, internal--image_tools | |
| Recipes: base, runit, chef-client, omnibus_updater, chef-client::config, ohai, hvst::route53, tmux, grc, zsh, users::sysadmins, hostname, resolver, ntp, logwatch, logrotate, papertrail-cookbook, openssh, sysctl, iptables, hvst::iptables, sudo, denyhosts, chkrootkit, rkhunter, postfix::sasl_auth, postfix::aliases, datadog::dd-agent, datadog::dd-handler, datadog::network, htop, monit, newrelic-sysmond, sysstat, curl, git, rsync, vim, xml, xslt, zip, build-essential, postgresql::libpq, imagemagick, imagemagick::devel, hvst::ruby, nodejs, hvst::rails, hv |
| ### Git Workflow | |
| Answering the following questions helps you choose a branch workflow: | |
| * Where do important phases of development occur? | |
| * How can you identify (and backport) groups of related change? | |
| * Do you have work which often needs to be updated in multiple distinct long-lived branches? | |
| * What happens when emergency patches are required? | |
| * What should a branch for a particular purpose (including user-tactical) be named? | |
| * What is the lifecycle of a branch? |
| CREATE OR REPLACE FUNCTION GETUTCDATE() RETURNS TIMESTAMP AS ' | |
| SELECT CAST(LOCALTIMESTAMP AT TIME ZONE ''UTC'' AS TIMESTAMP); | |
| ' LANGUAGE SQL VOLATILE; | |
| GETUTCDATE(); |
| printer = ->(msg) { puts "#{msg}" } | |
| logger = ->(msg) { File.open("test.txt", "a") {|f| f.write(msg) } } | |
| class Person | |
| def initialize(first_name, last_name) | |
| @first_name, @last_name = first_name, | |
| last_name | |
| end |
| require "forwardable" | |
| class Items | |
| include Enumerable | |
| extend Forwardable | |
| def_delegators :@all, :each, :map, :inject, | |
| :reduce, :select, :reject | |
| attr_reader :all, :filtered |
| alias rtest='ruby -Ilib -Itest ' | |
| alias gs="git status" | |
| alias gcb="git checkout -b " | |
| alias gch="git checkout " | |
| alias gca="git commit -a" | |
| alias gpo="git push origin " | |
| alias gri="git rebase -i " | |
| alias gfo="git fetch origin" | |
| alias gl='git log --pretty='\''format:%Cblue%h%d%Creset %ar %Cgreen%an%Creset %s'\'' --graph' |
| create_table "bonds", :force => true do |t| | |
| t.string "currency" | |
| t.string "display_name" | |
| t.decimal "current_yield", :precision => 19, :scale => 4 | |
| t.decimal "previous_yield", :precision => 19, :scale => 4 | |
| t.datetime "close_date" | |
| t.string "ric" | |
| t.datetime "created_at", :null => false | |
| t.datetime "updated_at", :null => false | |
| end |