Skip to content

Instantly share code, notes, and snippets.

@jpbarto
jpbarto / ide-lifecycle.sh
Last active May 15, 2020 20:03
Lifecycle script for SageMaker notebook startup which installs Theia-IDE
#!/bin/bash
set -e
sudo -u ec2-user -i <<'EOP'
## INSTALL THEIA IDE FROM SOURCE
EC2_HOME=/home/ec2-user
mkdir ${EC2_HOME}/theia && cd ${EC2_HOME}/theia
### begin by installing NVM, NodeJS v10, and Yarn
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ambakshi
ambakshi / iam-assume-role.sh
Last active October 25, 2021 15:50
Assume an IAM role. An interesting way of doing IAM roles is to give the instance permissions to assume another role, but no actual permissions by default. I got this idea while setting up security monkey: http://securitymonkey.readthedocs.org/en/latest/quickstart1.html#setup-iam-roles.
#!/bin/bash
#
# Assume the given role, and print out a set of environment variables
# for use with aws cli.
#
# To use:
#
# $ eval $(./iam-assume-role.sh)
#