Instantly share code, notes, and snippets.

Susovan Panja susovanpanja

View GitHub Profile
@susovanpanja
susovanpanja / mongodb-s3-backup.sh
Created Feb 11, 2019 — forked from eladnava/mongodb-s3-backup.sh
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
View mongodb-s3-backup.sh
#!/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
View Escaping Special Characters
The following characters have special meaning to the shell itself in some contexts and may need to be escaped in arguments:
` Backtick (U+0060 Grave Accent)
~ Tilde (U+007E)
! Exclamation mark (U+0021)
# Hash (U+0023 Number Sign)
$ Dollar sign (U+0024)
& Ampersand (U+0026)
* Asterisk (U+002A)
( Left Parenthesis (U+0028)
@susovanpanja
susovanpanja / wget-jdk-oracle-install-example.txt
Created Jun 11, 2018 — forked from scottvrosenthal/wget-jdk-oracle-install-example.txt
wget command to install Oracle JAVA JDK from stupid oracle website for centos and ubuntu
View wget-jdk-oracle-install-example.txt
http://d.stavrovski.net/blog/post/how-to-install-and-setup-oracle-java-jdk-in-centos-6
# rpm
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \
-O jdk-7-linux-x64.rpm
# ubuntu
@susovanpanja
susovanpanja / cft-travis-sample.yml
Created Apr 10, 2018 — forked from grdnrio/cft-travis-sample.yml
Example Travis file for verifying CloudFormation templates
View cft-travis-sample.yml
language: ruby
git:
submodules: false
env:
global:
- AWS_DEFAULT_REGION=eu-west-1
- secure: somestring
- secure: somestring
@susovanpanja
susovanpanja / sns-publish
Created Mar 26, 2018 — forked from jeremypruitt/sns-publish
AWS Lambda function to publish to SNS topic
View sns-publish
console.log('Loading function');
var AWS = require('aws-sdk');
AWS.config.region = 'us-west-2';
exports.handler = function(event, context) {
console.log("\n\nLoading handler\n\n");
var sns = new AWS.SNS();
sns.publish({