Get a local git repo up on an EC2 Instance.
Add yourself to the ssh auth agent, if you haven't already.
ssh-add path/to/your/EC2.pem
#!/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 |
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 | |
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.