tanut aran

My case is when I initialize the database in WSL2 and try to access it with GUI tool on the Window, for example, Dbeaver, DB for SQLite etc.

Possible Cause

From internet search, seem like the WSL path \\wsl$\Ubuntu ... is the problem.

So the file must be on the Window path

Linking Workaround

Now we move the database file to Window path.

As an example foo.db is in my desktop.

Now link it into our WSL machine. Note that we need flag -s.

Also note that way to access Window’s file in WSL2 is through /mnt/c/...

Command
ln -s <source path> <destination path>
Inside WSL2
ln -s /mnt/c/Users/Tanut/Desktop/foo.db ./foo.db

Now we can:

  1. Access from GUI from Window machine
  2. Have convenient short path that can access from WSL machine

Hope this help !

--

--

Million times come across Java software and it needs some weird things called JAVA_HOME

How to find

Assume already install java , you can check it by java -version

Then trace the link back to the real location:

readlink -f $(which javac)

This will give you back something like

/usr/lib/jvm/java-11-openjdk-amd64/bin/javac

Then the Java home is the parent path of bin

JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/

Hope this save you sometimes !

--

--

This is a time when you Docker size is BIG!

Then we need to see inside.

Command

Start your CLI inside the Docker

docker run -it --entrypoint /bin/sh <your_container_name>

It is important to skip entrypoint that will sometimes break the run if you not yet inject any environment.

Investigate space with command

du -sch *

to see the summary of the result

Then the hidden files

du -sh .[^.]*

--

--