Skip to content

Instantly share code, notes, and snippets.

@jaffarc
jaffarc / start-mongo-replset.sh
Created September 12, 2018 18:39 — forked from leetreveil/start-mongo-replset.sh
Shell scripts to create a mongodb replica set and sharded cluster locally
#!/bin/bash
# shell script to create a simple mongodb replica set (tested on osx)
set -e
red=$(tput setaf 1)
green=$(tput setaf 2)
yellow=$(tput setaf 3)
default=$(tput sgr0)
@jaffarc
jaffarc / mongo_backup.sh
Created April 22, 2018 02:19 — forked from sheharyarn/mongo_backup.sh
Mongodump Shell Script for Cronjob
#!/bin/bash
MONGO_DATABASE="your_db_name"
APP_NAME="your_app_name"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
TIMESTAMP=`date +%F-%H%M`
MONGODUMP_PATH="/usr/bin/mongodump"
BACKUPS_DIR="/home/username/backups/$APP_NAME"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<ul>
<li>aaa</li>
<li>bbb</li>
@jaffarc
jaffarc / gist:3045707e752730b67fb49b32eff5d627
Last active April 26, 2016 01:36
check modified files. Nodejs
var fs = require('fs'),
path = require('path'),
caminho = path.resolve("..\\content\\");
var Config = function () {};
Config.prototype.modification = function (){
var arr = [],
Data = [{
itens : []