-
On the primary, edit /etc/mongod.conf so that it will start and join the
evgrs
replica set. -
On the primary, restart mongod
-
Get into a mongo console, and run the following series of commands:
// First we need to connect to the mongo console and copy the current configuration. cfg = rs.conf()
This file contains 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
namespace :failover do | |
desc 'Roll failover back to primary database configuration' | |
task :primary do | |
File.delete('config/database.yml') | |
symlink('database.primary.yml', 'config/database.yml') | |
end | |
end | |
desc 'Failover to secondary database configuration' | |
task :failover do |
This file contains 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
class PlainBot | |
include Robot | |
def tick(events) | |
get_up_to_speed | |
turn(2) if (time % turn_adjust == 0) | |
if events['robot_scanned'].empty? | |
turn_gun(1) | |
else | |
closest = events['robot_scanned'].sort.pop.pop |
This file contains 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
class Person | |
include Renewable | |
attr_accessor :name, :age | |
def celebrate_birthday | |
self.renew(age: age + 1) | |
end | |
end | |
john = Person.new(name: 'John', age: 24) |
I hereby claim:
- I am plainprogrammer on github.
- I am plainprogrammer (https://keybase.io/plainprogrammer) on keybase.
- I have a public key whose fingerprint is BF75 7722 AE10 7AE8 4C85 9DE5 5A1F 973B AEB0 18AF
To claim this, I am signing this object:
This file contains 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
worker_processes 5; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; |
This file contains 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
load 'deploy' if respond_to?(:namespace) # cap2 differentiator | |
################################## | |
# Edit these | |
set :application, "app_name" | |
set :node_file, "server.js" | |
set :host, "app.example.com" | |
set :repository, "git://github.com/example/example.git" | |
set :branch, "master" | |
set :deploy_to, "/var/apps/#{application}" |
This file contains 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
--- | |
:verbose: true | |
gem: --no-ri --no-rdoc | |
:update_sources: true | |
:sources: | |
- http://gems.rubyforge.org | |
:backtrace: false | |
:bulk_threshold: 1000 | |
:benchmark: false |
This file contains 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
%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%} %{$GIT_PROMPT_INFO%}$(git_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ%{$reset_color%} |
This file contains 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
audio = Audio.first | |
configuration = RefNetAdmin::Application.config.zencoder | |
id = audio.id | |
bucket = configuration['bucket'] | |
base_path = configuration['base_path'] | |
options = { | |
input: audio.file.url(:original), | |
outputs: [ |
OlderNewer