Skip to content

Instantly share code, notes, and snippets.

View theabhinavdas's full-sized avatar
👨‍💻
building the future

Abhinav Das theabhinavdas

👨‍💻
building the future
View GitHub Profile
@lucis
lucis / mongo_backup.sh
Last active June 14, 2023 20:31
Mongo DB Backup + Gdrive Upload
#!/bin/sh
cd /tmp
FILE=`date +%m%d%y%S`
DEST=mongodb-backup/$FILE.gz
DB_NAME=database-name
# This PARENT_FOLDER is a reference to a Google Drive folder in your account (like, "my-backups").
# Use gdrive list to get the ID of the folder you want
PARENT_FOLDER=186AdURawhC3qJDL7OkGL9ueJmU44pteV
mongodump -d $DB_NAME --archive=$DEST --gzip
@nick-desteffen
nick-desteffen / Javascript RandomDate
Created December 14, 2012 15:27
Function to generate a random date between 2 dates
start = new Date(2001, 0, 1)
end = new Date()
function randomDate(start, end) {
return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()))
}
//http://apod.nasa.gov/apod/ap950616.html