Skip to content

Instantly share code, notes, and snippets.

View droidlabour's full-sized avatar
🏠
Working from home

Joy Prakash Sharma droidlabour

🏠
Working from home
View GitHub Profile
@eladnava
eladnava / mongodb-s3-backup.sh
Last active March 11, 2024 10:21
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
@matthewoden
matthewoden / AWS Git Setup.md
Created May 22, 2016 17:48
Setting up a remote Git in AWS EC2

AWS Remote Git Setup

Get a local git repo up on an EC2 Instance.

Add youself to SSH Authentication:

Add yourself to the ssh auth agent, if you haven't already.

ssh-add path/to/your/EC2.pem

Set up destination directory:

@aws-scripting-guy
aws-scripting-guy / get_account_id_lambda.py
Created March 6, 2016 23:49
Get AWS account id inside Lambda function programmatically - python
def lambda_handler(event, context):
# Get Account Id from lambda function arn
print "lambda arn: " + context.invoked_function_arn
# Get Account ID from lambda function arn in the context
ACCOUNT_ID = context.invoked_function_arn.split(":")[4]
print "Account ID=" + ACCOUNT_ID
@rubencaro
rubencaro / install_elixir.md
Last active September 30, 2023 03:58
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.