merged
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 11 Mar 2024 16:09:03 +0200
changeset 2588 6c5859f2cff6
parent 2584 c3dcc61e9e3d (diff)
parent 2587 0230a6677c40 (current diff)
child 2589 608c75053bf0
merged
--- a/cygwin.rst	Sat Feb 17 23:00:15 2024 +0200
+++ b/cygwin.rst	Mon Mar 11 16:09:03 2024 +0200
@@ -12,6 +12,24 @@
 http://cygwin.com/mirrors.html
   Official mirror list.
 
+Download installed, run it and additionally select:
+
+* ``make`` to install my personal configs
+* ``git`` to clone ``apt-cyg``
+* ``wget``, ``libiconv`` are dependencies for ``apt-cyg``
+
+Add Cygwin's ``/bin`` to Windows' ``PATH`` so you could lauch ``mintty`` and clone ``apt-cyg`` and
+add it to ``PATH`` too::
+
+  cd ~/work/cygwin
+  git clone https://github.com/kou1okada/apt-cyg
+  cp apt-cyg/apt-cyg ~/.local/bin
+
+Integrate bash-completion for ``apt-cyg``::
+
+  apt-cyg install bash-completion
+  apt-cyg completion-install
+
 Important packages:
 
 * ``bash-completion`` - for human CLI.
--- a/wsl.rst	Sat Feb 17 23:00:15 2024 +0200
+++ b/wsl.rst	Mon Mar 11 16:09:03 2024 +0200
@@ -176,3 +176,34 @@
   [wsl2]
   kernel=C:\\Users\\<USER>\\vmlinux
 
+Enabling trimming
+=================
+
+::
+
+  wsl --manage $NAME --set-sparse true
+  wsl --manage $NAME --set-sparse false
+
+or in ``.wslconfig``::
+
+  [experimental]
+  sparseVhd=true
+
+https://devblogs.microsoft.com/commandline/windows-subsystem-for-linux-september-2023-update/#automatic-disk-space-clean-up-set-sparse-vhd
+  Automatic disk space clean up (Set sparse VHD).
+
+Legacy solutions were based on re-importing existing image, like:
+
+https://github.com/okibcn/wslcompact
+  Compacts the size of the ever-growing WSL vhdx images.
+
+or filling with zeros and processing VHD:
+
+https://github.com/bendover94/reclaim_wsl_mem
+  ``sudo dd if=/dev/zero of=/0bits bs=20M`` + ``Optimize-VHD``.
+
+Check TRIM support in the distro::
+
+  sudo apt install hdparm
+  sudo hdparm -I /dev/sdc
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xdg.rst	Mon Mar 11 16:09:03 2024 +0200
@@ -0,0 +1,24 @@
+
+=====
+ XDG
+=====
+
+Spec
+====
+
+====================  ==========================
+``XDG_DATA_HOME``     ``$HOME/.local/share``
+``$XDG_CONFIG_HOME``  ``$HOME/.config``
+``$XDG_STATE_HOME``   ``$HOME/.local/state``
+====================  ==========================
+
+Distributions should ensure ``$HOME/.local/bin`` shows up in PATH.
+
+
+https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
+  XDG Base Directory Specification.
+
+https://wiki.archlinux.org/title/XDG_Base_Directory
+  Arch Linux XDG Base Directory.
+https://wiki.archlinux.org/title/XDG_user_directories
+  Arch Linux XDG user directories.