Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
WSL Provisionig Script
sudo echo "[automount]" | tee -a /etc/wsl.config
sudo echo "root=/" | tee -a /etc/wsl.config
#copy user files
mkdir ~/.ssh
chmod 755 ~/.ssh
cp /mnt/c/Users/mail/.ssh/config ~/.ssh/config
chmod 600 ~/.ssh/config
cp /mnt/c/Users/mail/.ssh/id_rsa ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
cp /mnt/c/Users/mail/.ssh/ ~/.ssh/
chmod 600 ~/.ssh/
mkdir ~/.composer
chmod 777 ~/.composer
ln -sf /c/Users/mail/AppData/Roaming/Composer/auth.json ~/.composer/auth.json
ln -sf /c/Users/mail/.gitconfig ~/.gitconfig
ln -sf /c/Users/mail/.gitattributes ~/.gitattributes
ln -sf /c/Users/mail/.gitignore ~/.gitignore
echo "" | tee -a ~/.bashrc
echo "#Config" | tee -a ~/.bashrc
echo "export DOCKER_HOST=tcp://" | tee -a ~/.bashrc
echo "export WP_CLI_PACKAGES_DIR=/c/dev/tools/cli/wp-cli" | tee -a ~/.bashrc
sudo ln -sf /c/dev/tools/cli/wp-cli.phar /usr/bin/wp
sudo ln -sf /c/dev/tools/cli/phpunit.phar /usr/bin/phpunit
sudo ln -sf /c/dev/tools/cli/deployer.phar /usr/bin/dep
sudo ln -sf /c/dev/tools/cli/composer.phar /usr/bin/composer
sudo ln -sf /c/dev/config/inpsyde-php-coding-standards/vendor/squizlabs/php_codesniffer/bin/phpcs /usr/bin/phpcs
sudo ln -sf /c/dev/config/inpsyde-php-coding-standards/vendor/squizlabs/php_codesniffer/bin/phpcbf /usr/bin/phpcbf
sudo ln -sf /c/dev/tools/cli/phpDocumentor.phar /usr/bin/phpdoc
sudo ln -sf /c/dev/tools/cli/phive.phar /usr/bin/phive
sudo ln -sf /c/dev/tools/cli/phpbu.phar /usr/bin/phpbu
sudo ln -sf /c/dev/tools/cli/phploc.phar /usr/bin/phploc
sudo ln -sf /c/dev/tools/cli/phpmd.phar /usr/bin/phpmd
sudo ln -sf /c/dev/tools/cli/codecept.phar /usr/bin/codecept
sudo locale-gen de_DE.utf8
sudo update-locale LANG=de_DE.utf-8
sudo apt-get install -y curl wget
#add repros
sudo add-apt-repository ppa:git-core/ppa -y
sudo add-apt-repository ppa:ondrej/php -y
curl -sL | sudo -E bash -
#install packeges
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y subversion git zip build-essential
#sudo sed -i 's/Port 22/Port 2222/g' /etc/ssh/sshd_config
sudo sed -i 's/UsePrivilegeSeparation yes/UsePrivilegeSeparation no/g' /etc/ssh/sshd_config
sudo sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
echo "%sudo ALL=(ALL) NOPASSWD: /usr/sbin/service ssh --full-restart" | sudo tee -a /etc/sudoers
sudo service ssh --full-restart
sudo apt-get install -y mariadb-client
sudo apt-get install -y php7.2-cli
sudo apt-get install -y php7.2-curl php7.2-xml php7.2-zip php7.2-gd php7.2-mysql php7.2-mbstring php7.2-soap php-xdebug php-imagick
sudo phpdismod xdebug
cd /tmp
sudo curl -L > /tmp/docker.tgz
sudo tar xvof /tmp/docker.tgz
sudo rm /tmp/docker.tgz
sudo cp docker/docker /usr/bin/docker
sudo chmod +x /usr/bin/docker
sudo rm -r docker/
sudo curl -L`uname -s`-`uname -m` > /tmp/docker-compose
sudo cp /tmp/docker-compose /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose
sudo rm -r /tmp/docker-compose
cd ~
sudo apt-get install -y nodejs
sudo npm update npm -g
sudo npm install grunt -g
sudo npm install gulp -g
sudo apt-get install -y ruby ruby-dev
sudo gem update --system
sudo gem install sass --no-user-install
sudo apt-get install jpegoptim optipng
sudo apt-get update
sudo apt-get upgrade -y
sudo apt autoremove -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.