Skip to content

Instantly share code, notes, and snippets.

@duboiss
Last active June 19, 2024 20:26
Show Gist options
  • Save duboiss/2b2c6176400fc93b7a2b8995e1b1eaf8 to your computer and use it in GitHub Desktop.
Save duboiss/2b2c6176400fc93b7a2b8995e1b1eaf8 to your computer and use it in GitHub Desktop.
WSL auto install
#!/bin/bash
updatePackages () {
echo "Updating packages"
sudo add-apt-repository ppa:parkmino/nano -y
sudo add-apt-repository ppa:git-core/ppa -y
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update
sudo apt upgrade -y
}
php () {
echo "Installing PHP"
sudo apt install php8.2 -y
sudo apt install php8.2-{amqp,apcu,curl,gd,imap,intl,mbstring,mysql,pgsql,redis,soap,sqlite3,xdebug,xml,zip} unzip -y
}
composer () {
echo "Installing composer"
wget -O composer-setup.php https://getcomposer.org/installer
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
rm composer-setup.php
}
symfony () {
echo "Installing symfony cli"
curl -sS https://get.symfony.com/cli/installer | bash
sudo mv "$HOME"/.symfony/bin/symfony /usr/local/bin/symfony
}
rust () {
echo "Installing rust with cargo"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME"/.cargo/env
}
volta () {
echo "Installing volta with node and yarn"
curl https://get.volta.sh | bash
~/.volta/bin/./volta install node yarn
}
zsh () {
echo "Installing zsh"
sudo apt install zsh -y
chsh -s "$(which zsh)"
zsh
}
ohmyzsh () {
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/paulirish/git-open ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/git-open
sed -i '/^plugins/d' ~/.zshrc
echo "plugins=(docker git-open sudo yarn zsh-autosuggestions zsh-syntax-highlighting)" >> ~/.zshrc
#source ~/.zshrc
}
updatePackages
php
composer
symfony
rust
volta
zsh
#ohmyzsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment