Skip to content

Instantly share code, notes, and snippets.

View ssrsinghrajput's full-sized avatar

Shani Singh ssrsinghrajput

  • India
View GitHub Profile
@ssrsinghrajput
ssrsinghrajput / mongodb-s3-backup.sh
Created November 2, 2019 07:20 — forked from eladnava/mongodb-s3-backup.sh
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh
#!/usr/bin/python
import urllib2
from bs4 import BeautifulSoup
import requests
import re
import urllib
import sys
import os
episodeArray=[]
import requests
import datetime
import time
from random import randrange
TOKEN = "" # add your access token here, with publish_stream permission
def main():
todays_start_unixtimestamp = int(time.mktime((datetime.datetime(datetime.date.today().year, datetime.date.today().month, datetime.date.today().day, 0, 0, 0)).timetuple()))
for making cors work
https://github.com/ssrsinghrajput/django-cors-headers