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
| systemLog: | |
| destination: file | |
| path: '/usr/local/var/log/mongodb/mongodcfg.log' | |
| logAppend: true | |
| storage: | |
| dbPath: '/usr/local/var/mongodcfg' | |
| journal: | |
| enabled: true | |
| processManagement: | |
| fork: true |
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
| systemLog: | |
| destination: file | |
| path: '/usr/local/var/log/mongodb/mongos.log' | |
| logAppend: true | |
| processManagement: | |
| fork: true | |
| pidFilePath: '/var/run/mongodb/mongos.pid' | |
| net: | |
| bindIp: | |
| - 127.0.0.1 |
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
| systemLog: | |
| destination: file | |
| path: '/usr/local/var/log/mongodb/mongod0.log' | |
| logAppend: true | |
| storage: | |
| dbPath: '/usr/local/var/mongodb0' | |
| directoryPerDB: true | |
| journal: | |
| enabled: true | |
| engine: wiredTiger |
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
| #!/bin/bash | |
| # Sample /etc/mongos.conf file | |
| # logpath=/var/log/mongodb/mongos.log | |
| # logappend=true | |
| # fork=true | |
| # configdb=cfg0.example.com:27019,cfg1.example.com:27019,cfg2.example.com:27019 | |
| # pidfilepath=/var/run/mongodb/mongos.pid | |
| # mongos - Startup script for mongos |
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
| #!/bin/bash | |
| # mongod - Startup script for mongod | |
| # chkconfig: 2345 85 15 | |
| # description: Mongo is a scalable, document-oriented database. | |
| # processname: mongod | |
| # config: /etc/mongod.conf | |
| # pidfile: /var/run/mongodb/mongod.pid |
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
| #!/bin/bash | |
| # How to use | |
| # | |
| # * make a copy of the mongod binary on /usr/bin/mongod | |
| # `sudo cp /usr/bin/mongod /usr/bin/mongodarb` | |
| # * copy this init script inside /etc/init.d/mongodarb | |
| # * assumes the arbiter process config file is on /etc/mongodarb.conf | |
| # * reset chkconfig with: | |
| # `sudo chkconfig mongodarb reset` |
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
| { | |
| "AF" => { country_name: "Afghanistan", country_code_alpha2: "AF", country_code_alpha3: "AFG", numeric_code: 4 }, | |
| "AX" => { country_name: "Åland", country_code_alpha2: "AX", country_code_alpha3: "ALA", numeric_code: 248 }, | |
| "AL" => { country_name: "Albania", country_code_alpha2: "AL", country_code_alpha3: "ALB", numeric_code: 8 }, | |
| "DZ" => { country_name: "Algeria", country_code_alpha2: "DZ", country_code_alpha3: "DZA", numeric_code: 12 }, | |
| "AS" => { country_name: "American Samoa", country_code_alpha2: "AS", country_code_alpha3: "ASM", numeric_code: 16 }, | |
| "AD" => { country_name: "Andorra", country_code_alpha2: "AD", country_code_alpha3: "AND", numeric_code: 20 }, | |
| "AO" => { country_name: "Angola", country_code_alpha2: "AO", country_code_alpha3: "AGO", numeric_code: 24 }, | |
| "AI" => { country_name: "Anguilla", country_code_alpha2: "AI", country_code_alpha3: "AIA", numeric_code: 660 }, | |
| "AQ" => { country_name: "Antarctica", country_code_alpha2: "AQ", country_code_alpha3: "ATA", numeric_code: 10 }, |
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
| respond_with Mongoid.default_session.command( | |
| aggregate: 'data_points', | |
| pipeline: pipeline, | |
| allowDiskUse: true | |
| )['result'].map { |dp| User.new(dp['user']) } |
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 'keen' | |
| Keen.write_key = ENV['KEEN_WRITE_KEY']; | |
| Keen.read_key = ENV['KEEN_READ_KEY']; | |
| Keen.master_key = ENV['KEEN_MASTER_KEY']; | |
| Keen.project_id = ENV['KEEN_PROJECT_ID']; |
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
| class BankAccount < ActiveRecord::Base | |
| before_save EncryptionWrapper.new | |
| after_save EncryptionWrapper.new | |
| after_initialize EncryptionWrapper.new | |
| end | |
| class EncryptionWrapper | |
| def before_save(record) | |
| record.credit_card_number = encrypt(record.credit_card_number) | |
| end |