Skip to content

Instantly share code, notes, and snippets.

View praveenjha527's full-sized avatar
💭
I may be slow to respond.

Praveen Jha praveenjha527

💭
I may be slow to respond.
View GitHub Profile
@praveenjha527
praveenjha527 / aws-temp-token.sh
Created December 27, 2019 10:05 — forked from ogavrisevs/aws-temp-token.sh
Script to generate AWS STS token
#!/bin/bash
#
# Sample for getting temp session token from AWS STS
#
# aws --profile youriamuser sts get-session-token --duration 3600 \
# --serial-number arn:aws:iam::012345678901:mfa/user --token-code 012345
#
# Based on : https://github.com/EvidentSecurity/MFAonCLI/blob/master/aws-temp-token.sh
#
@praveenjha527
praveenjha527 / gist:7286782c96a26ca660741117b5951ab3
Created November 7, 2017 14:06 — forked from tott/gist:3895832
create cpu load in python
#!/usr/bin/env python
"""
Produces load on all available CPU cores
"""
from multiprocessing import Pool
from multiprocessing import cpu_count
def f(x):
while True:
@praveenjha527
praveenjha527 / mongodb-s3-backup.sh
Created March 2, 2017 05:15 — 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