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' |
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
# | |
# 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
"abaixo", "aca", "acaso", | |
"acerca", "acima", "acola", "acula", "ademais", "adentro", | |
"adiante", "afinal", "afora", "agora", "agorinha", "ah", "ainda", | |
"alem", "algo", "alguem", "algum", "alguma", "algumas", "alguns", | |
"ali", "alias", "alo", "ambos", "amiude", "ante", "antes", "ao", | |
"aonde", "aos", "apenas", "apesar", "apos", "apud", "aquela", | |
"aquelas", "aquele", "aqueles", "aqui", "aquilo", "as", "assim", | |
"ate", "atras", "atraves", "basicamente", "bastante", "bastantes", | |
"bem", "bis", "bom", "ca", "cada", "cade", "caso", "certa", | |
"certamente", "certas", "certeiramente", "certo", "certos", "chez", |
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 | |
cd /data/backups/ | |
mongodump -d <dbname> | |
today=$(date +"%Y%m%d") && tar cvzf "<dbname>-$today.tar.gz" dump/ |
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
mongoexport -d <db_name> -c <coll_name> -f <fields_name> -q "<json_query>" --csv --out out_file.csv |
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
/* | |
gulpfile.js | |
Directory structure | |
./dist [webapp compiled] | |
./src/ [webapp code] | |
./src/app [react code] | |
./src/assets [css and js files] | |
*/ | |
var argv = require('yargs').argv; |
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
Verifying that +nassor is my blockchain ID. https://onename.com/nassor |
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 | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
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
package filter | |
import ( | |
"fmt" | |
"testing" | |
"time" | |
"github.com/nats-io/nuid" | |
) |
OlderNewer