Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sam0x17
Last active May 28, 2022 21:26
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sam0x17/96341dc73e195c52d057f514d43d120f to your computer and use it in GitHub Desktop.
Save sam0x17/96341dc73e195c52d057f514d43d120f to your computer and use it in GitHub Desktop.
install brew and add to environment
#!/bin/bash
# update apt
sudo apt-get update || exit 1
sudo apt-get upgrade -y || exit 1
sudo apt-get dist-upgrade -y || exit 1
# install required apt packages
sudo apt-get install p7zip-full \
git p7zip-full curl gnupg2 libssl-dev libxml2-dev \
libyaml-dev libgmp-dev libz-dev ubuntu-budgie-desktop \
gnome-tweaks python3-pip default-jre -y || exit 1
# install brew
curl -o- https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/$USER/.profile
source ~/.bashrc
source ~/.profile
# things depending on brew
brew --version || exit 1
brew install awsebcli || exit 1
# things depending on pip
pip3 install awscli || exit 1
# crystal lang
curl -fsSL https://crystal-lang.org/install.sh | sudo bash
source ~/.bashrc
crystal --version || exit 1
# nvm / node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
echo '
# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> ~/.profile
source ~/.profile
source ~/.bashrc
nvm --version || exit 1
nvm install --lts --default || exit 1
nvm use --lts || exit 1
node --version || exit 1
npm install -g eslint yarn stylelint || exit 1
# rvm / ruby
gpg --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
7D2BAF1CF37B13E2069D6956105BD0E739499BDB || exit 1
\curl -sSL https://get.rvm.io | bash -s stable
source /home/$USER/.rvm/scripts/rvm || exit 1
source ~/.profile || exit 1
source ~/.bashrc || exit 1
rvm --version || exit 1
#rvm get stable --auto-dotfiles || exit 1
rvm install ruby --latest -j 8 || exit 1
rvm use --latest || exit 1
gem install bundler || exit 1
rvm install 2.7.2 -j 8 || exit 1
rvm use 2.7.2 || exit 1
gem install bundler || exit 1
gem install rubocop || exit 1
gem install jets || exit 1
gem install rails || exit 1
rvm use --latest --default || exit 1
ruby --version || exit 1
# set up budgie-desktop within WSL
echo "export DISPLAY=\$(cat /etc/resolv.conf | grep nameserver | awk '{print \$2}'):0" >> ~/.bashrc
echo 'export LIBGL_ALWAYS_INDIRECT=1' >> ~/.bashrc
cd ~ || exit 1
echo "enabling systemd..."
git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git || exit 1
cd ubuntu-wsl2-systemd-script || exit 1
bash ubuntu-wsl2-systemd-script.sh
cd .. || exit 1
rm -rf ubuntu-wsl2-systemd-script || exit 1
source ~/.profile
source ~/.bashrc
echo "systemd has been has been enabled."
sudo systemctl disable systemd-remount-fs.service || exit 1
sudo systemctl disable multipathd.socket || exit 1
sudo usermod -a -G adm $USER || exit 1
sudo usermod -a -G sudo $USER || exit 1
gsettings set org.gnome.desktop.interface gtk-theme "Arc-Dark" || exit 1
gsettings set org.gnome.desktop.wm.preferences theme "Arc-Dark" || exit 1
gsettings set com.gexperts.Tilix.Profile:/default/ login-shell true || exit 1
gsettings set com.gexperts.Tilix.Profile:/default/ background-transparency-percent 15 || exit 1
# set up postgresql, which requires systemd to work
echo "setting up postgresql..."
sudo apt-get install postgresql postgresql-contrib libpq-dev -y
sudo systemctl start postgresql
sudo -i -u postgres || exit 1
createuser -s $USER || exit 1
exit
whoami || exit 1
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment