Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dospuntocero/bbd8ccfd8cff725db7b9448fc74640c5 to your computer and use it in GitHub Desktop.
Save dospuntocero/bbd8ccfd8cff725db7b9448fc74640c5 to your computer and use it in GitHub Desktop.
how to enable ubuntu over WSL with phpstorm for proper file lineendings and a decent super fast workflow
Usage
You need git to be installed for the commands below to work. Use
sudo apt install git
to do so.
Run the script and commands
git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
cd ubuntu-wsl2-systemd-script/
bash ubuntu-wsl2-systemd-script.sh
# Enter your password and wait until the script has finished
Then restart the Ubuntu shell and try running systemctl
systemctl
If you don't get an error and see a list of units, the script worked.
Have fun using systemd on your Ubuntu WSL2 image. You may use and change and distribute this script in whatever way you'd like.
snapd will be fucked, so you need to run this
1. $ sudo service snapd stop
2. $ sudo apt purge snapd
3. $ sudo apt install snapd
or maybe this systemctl restart snapd.seeded.service
using x410, on ubuntu terminal type
export DISPLAY=$(awk '/^nameserver/ {print $2; exit;}' </etc/resolv.conf):0.0
sudo snap install phpstorm --classic --edge
Try starting PHPStorm by running phpstorm in your terminal. As I'm lazy, I added the following alias to .bashrc:
alias storm='phpstorm > /dev/null 2>&1 &'
PHPStorm will probably complain about file sync being slow when you start it - that's because we did not install inotify yet, which PHPStorm can utilize. To do so, type:
sudo apt-get install inotify-tools
As the default amount of files a user can watch is pretty low - especially if you are doing anything frontend related ;) - you can increase that number by adding the following line in /etc/sysctl.conf:
fs.inotify.max_user_watches = 524288
and applying the change:
sudo sysctl -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment