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
# | |
# Run as root | |
# $ bash <(curl -s https://raw.github.com/gist/1631411) | |
# | |
# Update, upgrade and install development tools: | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install build-essential git-core curl \ | |
libssl-dev \ |
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
// USUARIO SEG ------------------------------------------------------------------------------------------------------- | |
var map = function() { | |
var time = this.acesso.getTime() | |
emit({pessoa:this.pessoa, pessoa_id:this.pessoa_id, acao:this.acao, time: time, | |
ano:this.acesso.getFullYear(), mes:this.acesso.getMonth(), dia:this.acesso.getDate()}, 1) | |
} | |
var reduce = function(key, values) { | |
var r = { acessos: 0, acessos_usuarios: new Array(), acessos_referencias: new Array()}; |
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
namespace :mongodb do | |
task :start do | |
desc 'Start mongodb servers' | |
system 'mkdir -p ~/.mongodb/master/' | |
system 'mkdir -p ~/.mongodb/slave/1/' | |
system 'mkdir -p ~/.mongodb/slave/2/' | |
system 'mongod --dbpath ~/.mongodb/master/ --port 27018 --master --directoryperdb --fork --logpath ~/.mongodb/master/mongodb.log --logappend --pidfilepath ~/.mongodb/master/mongodb.pid' | |
system 'mongod --dbpath ~/.mongodb/slave/1/ --port 27019 --slave --source localhost:27018 --autoresync --directoryperdb --fork --logpath ~/.mongodb/slave/1/mongodb.log --logappend --pidfilepath ~/.mongodb/slave/1/mongodb.pid' | |
system 'mongod --dbpath ~/.mongodb/slave/2/ --port 27020 --slave --source localhost:27018 --autoresync --directoryperdb --fork --logpath ~/.mongodb/slave/2/mongodb.log --logappend --pidfilepath ~/.mongodb/slave/2/mongodb.pid' |
NewerOlder