Last active
May 8, 2023 12:19
-
-
Save spohnan/b96861da9bcf3b80f53c3fb81c6179a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Create a dev environment on AL2023 | |
# | |
# AWS CDK with toolchains for dev in [Python|NodeJS|Rust|TypeScript] | |
# | |
# OS Packages | |
sudo dnf -y install docker gcc git jq htop | |
# Docker compose plugin | |
curl -LO https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) | |
sudo mv docker-compose-$(uname -s)-$(uname -m) /usr/libexec/docker/cli-plugins/docker-compose | |
sudo chmod +x /usr/libexec/docker/cli-plugins/docker-compose | |
# Start Docker at boot and allow ec2-user access | |
sudo systemctl enable docker --now | |
sudo usermod -aG docker ec2-user | |
# NodeJS and CDK | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash | |
. ~/.bashrc | |
nvm install node | |
npm install -g aws-cdk@latest npm@latest typescript | |
# Rust | |
curl --proto '=https' --tlsv1.2 -sSf -o /tmp/rustup-init.sh https://sh.rustup.rs | sh -s -- -y | |
. "$HOME/.cargo/env" | |
# btop | |
sudo dnf install -y tar bzip2 | |
curl -Lo /tmp/btop.tbz https://github.com/aristocratos/btop/releases/download/v1.2.13/btop-x86_64-linux-musl.tbz | |
cd /tmp && tar xvf btop.tbz | |
sudo mv /tmp/btop/bin/btop* /usr/local/bin/ | |
echo ' | |
alias g="git status" | |
alias gb="git branch" | |
alias glog="git log --oneline --decorate" | |
alias pj="npx projen" | |
alias cdk="npx cdk" | |
alias cdky="npx cdk --require-approval never" | |
alias update="npm install -g aws-cdk@latest; rustup update; sudo dnf -y update" | |
' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir -p ~/dev | |
git config --global user.name "Andy Spohn" | |
git config --global user.email "[email protected]" | |
git config --global init.defaultBranch main | |
git config --global fetch.prune true | |
# Set up VSCode w/Remote SSH to use for a UI | |
# mwinit locally and then copy your certs to the box for 12 hours of access to GitLab | |
# scp ~/.ssh/id_rsa* dev-01:~/.ssh/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment