Last active
February 25, 2025 15:06
-
-
Save TiagoDanin/8273a9cec866017218668a9322944125 to your computer and use it in GitHub Desktop.
Install WSL Ubuntu 24.04.1 LTS + Elixir (Based on https://gist.github.com/TiagoDanin/2f788ea4b7c335a512cb6998381e1025)
This file contains hidden or 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
| # Configurations | |
| WINDOWS_USERNAME="tiago" | |
| # END | |
| echo "Installing WSL Ubuntu 22" | |
| sudo apt update | |
| sudo apt install neofetch | |
| neofetch | |
| echo "Install zsh" | |
| sudo apt install zsh curl git | |
| git config --global core.autocrlf false | |
| sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
| git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH/plugins/zsh-autosuggestions | |
| git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH/plugins/zsh-syntax-highlighting | |
| ls $ZSH/plugins | |
| sed -i 's/plugins=(git)/plugins=(git z zsh-autosuggestions zsh-syntax-highlighting)/g' .zshrc | |
| zsh | |
| echo "Install asdf and elixir dependencies" | |
| sudo apt install unzip libssl-dev make automake libncurses5-dev gcc g++ inotify-tools | |
| git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0 | |
| echo '\n# ASDF\n. "$HOME/.asdf/asdf.sh"' >> .zshrc | |
| zsh | |
| asdf plugin add erlang | |
| asdf plugin add elixir | |
| echo "Install sass dependencies" | |
| sudo apt install libsass-dev sassc wkhtmltopdf | |
| echo "Install PostgreSQL dependencies" | |
| sudo apt-get install postgresql postgis | |
| echo "Password is: postgres" | |
| sudo passwd postgres | |
| sudo service postgresql start | |
| echo "To allow all connection on postgres: sudo -u postgres psql" | |
| sudo sed -i "s/scram-sha-256/trust/g" /etc/postgresql/16/main/pg_hba.conf | |
| sudo service postgresql restart | |
| echo "Share SSH with WSL" | |
| sudo apt install keychain | |
| rm ~/.ssh | |
| mkdir ~/.ssh | |
| cp "/mnt/c/Users/$WINDOWS_USERNAME/.ssh/id_rsa" ~/.ssh | |
| cp "/mnt/c/Users/$WINDOWS_USERNAME/.ssh/id_rsa.pub" ~/.ssh | |
| cp "/mnt/c/Users/$WINDOWS_USERNAME/.ssh/known_hosts" ~/.ssh | |
| chmod 600 ~/.ssh/id_rsa | |
| echo "Share GitConfig with WSL" | |
| cp "/mnt/c/Users/$WINDOWS_USERNAME/.gitconfig" ~/.gitconfig | |
| git config --global core.autocrlf false | |
| echo "Install fly cli" | |
| curl -L https://fly.io/install.sh | sh | |
| echo '\n# FLY\nexport FLYCTL_INSTALL="/home/tiago/.fly"\nexport PATH="$FLYCTL_INSTALL/bin:$PATH"' >> .zshrc | |
| zsh | |
| echo "Finished" | |
| neofetch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment