VS Code – cannot rebase from terminal

If you receive error on rebase in terminal like

Unable to connect to VS Code server: Error in request.
Error: connect ENOENT /run/user/1000/vscode-ipc-5cc265b0-6bec-4e0e-99c7-8fc48bccd7c4.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1161:16) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'connect',
  address: '/run/user/1000/vscode-ipc-5cc265b0-6bec-4e0e-99c7-8fc48bccd7c4.sock'
}

Run

loginctl enable-linger $(whoami) 

It can show error and after creating dir /run/user/1000 with previous command, this can be corrected with setting correct env var VSCODE_IPC_HOOK_CLI

export VSCODE_IPC_HOOK_CLI=$(lsof | grep $USER | grep vscode-ipc | awk '{print $(NF-1)}' | head -n 1)

Link

Disable beep sound in WSL terminal on Windows

  1. To disable the beep in bash you need to uncomment (or add if not already there) the line set bell-style none in your /etc/inputrc file.Note: Since it is a protected file you need to be a privileged user to edit it (i.e. launch your text editor with something like sudo <editor> /etc/inputrc).
  2. To disable the beep also in vim you need to add set visualbell in your ~/.vimrc file.
  3. To disable the beep also in less (i.e. also in man pages and when using “git diff”) you need to add export LESS="$LESS -R -Q" in your ~/.profile file.

https://stackoverflow.com/a/36726662

PhpStorm (Idea) with Docker: BindException: Address already in use

Intellij Not starting and getting error (BindException: Address already in use) on system with Docker
Short resolution:
net stop winnat
net start winnat

Problem description:
This is /obviously/ not docker's problem (as best I can tell), it's probably not even hyperv's. Commenting here as this seems to be a frustrating and common end of journey for googlers. What follows is at least "one" of the resolutions/explanations.

On one of my machines the dynamic port range was not updated to the "new" start port, and I guess related to a resolved bug in windows has now "exposed" this as a serious problem (e.g.: I couldn't even bind to port 3000 for node dev -- access denied is I think a valid response, but it's not the typical "port in use" root cause).

Current dynamic port config:
> netsh int ipv[46] show dynamicport tcp

Unless you know you've mucked with these settings, and if it doesn't specify 49152 as "Start Port" and is set to 1025, it's not "current". I don't know if there is some kind of migration bug when they were patching this new value or what. Dynamic start port for udp was set correctly for example.

To set it to the current config:
> netsh int ipv[46] set dynamic tcp start=49152 num=16384

(Likely a reboot of your host is required.)

ref: https://support.microsoft.com/en-ca/help/929851/the-default-dynamic-port-range-for-tcp-ip-has-changed-in-windows-vista

While it's bizarre that I only just ran into this issue less than 4 hours ago -- been doing docker/node/go dev for the last few months straight, using docker edge, etc. This appears to have resolved my port exclusion issues (I have no large ranges of reserved ports below 50000 now, previously had 1000 port range exclusions all over the place.)

Install WSL on non-C drive

Open Powershell:

  • Run Set-Location DriveLetter: where DriveLetter is the drive where WSL will be installed
  • Then create a directory for WSL with New-Item WSL -Type Directory
  • Now set location there with Set-Location .\WSL
  • Now download the appx package with Invoke-WebRequest -Uri appx_package_url -OutFile Linux.appx -UseBasicParsing
  • Now we will unpack appx with Copy-Item .\Linux.appx .\Linux2.appx and then Rename-Item .\Linux2.appx -Newname "Linux2.zip" and then Expand-Archive .\Linux2.zip
  • Now Get-Childitem -Filter *.exe and you will find an .exe file named by the distro you downloaded. Run that to setup WSL you are done

List of links of wsl distros here