Skip to content

Instantly share code, notes, and snippets.

@popdemtech
Created August 17, 2022 03:05
Show Gist options
  • Select an option

  • Save popdemtech/253bfa3339befe2ee1524f5ec96f6c91 to your computer and use it in GitHub Desktop.

Select an option

Save popdemtech/253bfa3339befe2ee1524f5ec96f6c91 to your computer and use it in GitHub Desktop.
kitchen sink setup file for ubuntu. Usage: `. ./setup.sh`
#! /bin/bash
# Usage `. ./setup.sh`
# Notice the dot-space before the file name.
sudo apt-get update
echo "Checking for nginx"
if ! [-x "$(command -v nginx)"];then
sudo apt-get install nginx -y
fi
echo "We have nginx"
nginx -v
echo "Checking for ruby"
if ! [ -x "$(command -v ruby)" ];then
echo "Fetching libraries"
sudo apt update -y
sudo apt install -y git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev
echo "Fetching rbenv"
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git
PREFIX=/usr/local sudo ./ruby-build/install.sh
echo "Fetching Ruby 3.1.2"
rbenv install 3.1.2
rbenv global 3.1.2
ruby -v
fi
echo "We have ruby"
ruby -v
echo "We have gem"
gem -v
# Get Node 18
echo "Checking for NodeJS"
sudo apt-get install curl software-properties-common
if ! [ -x "$(command -v node)" ]; then
echo "Fetching nvm"
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc
echo "We have nvm"
nvm -v
echo "Fetching node 18"
nvm install 18
echo "We have node"
node -v
npm -v
fi
# Get Yarn
echo "Checking for Yarn"
if ! [ -x "$(command -v yarn)" ]; then
echo "Fetching yarn"
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get install --no-install-recommends yarn -y
echo "Successful"
fi
echo "We have yarn"
yarn --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment