Skip to content

Instantly share code, notes, and snippets.

View jjmartres's full-sized avatar
🚀
looking for a new position !

Jean-Jacques Martrès jjmartres

🚀
looking for a new position !
View GitHub Profile
@jjmartres
jjmartres / helm-chart-conventions.md
Last active November 3, 2024 00:32
Helm chart conventions
@jjmartres
jjmartres / how-to-shrink-a-wsl2-virtual-disk.md
Last active April 14, 2025 18:15
How to Shrink a WSL2 Virtual Disk

How to Shrink a WSL2 Virtual Disk

Before you begin

Before shrinking a WSL2 virtual disk, you need to ensure that WSL2 is not running.

You can check if it’s running with the command wsl.exe --list --verbose in PowerShell:

PS C:\Users\valorin> wsl.exe --list --verbose
 NAME STATE VERSION
@jjmartres
jjmartres / ubuntu-preseed.txt
Created July 12, 2021 07:24 — forked from refraction-ray/ubuntu-preseed.txt
sample preseed for ubuntu
#### Contents of the preconfiguration file (for stretch)
### direct copy from: https://help.ubuntu.com/lts/installation-guide/example-preseed.txt
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US
# The values can also be preseeded individually for greater flexibility.
#d-i debian-installer/language string en
#d-i debian-installer/country string NL
@jjmartres
jjmartres / how-to-reduce-size-of-docker-data-volume-in-docker-desktop-for-windows-v2.md
Last active May 14, 2025 08:23
How to reduce size of docker data volume in Docker Desktop for Windows v2

How to reduce size of docker data volume in Docker Desktop for Windows v2

Docker Desktop for Windows v2, which uses WSL2, stores all image and container files in a separate virtual volume (vhdx). This virtual hard disk file can automatically grow when it needs more space (to a certain limit). Unfortunately, if you reclaim some space, i.e. by removing unused images, vhdx doesn't shrink automatically.

Optimize

wsl --shutdown
Optimize-VHD -Path "$($env:LOCALAPPDATA)\Docker\wsl\data\ext4.vhdx" -Mode Full
@jjmartres
jjmartres / gh-bulk-clone.md
Created July 13, 2021 12:54
GitHub bulk clone

GitHub bulk clone

# download a maximum of 1000 @group's repos and organize them under `./group/`:
gh repo list group --limit 1000 | while read -r repo _; do
  gh repo clone "$repo" "$repo"
done
@jjmartres
jjmartres / excludeWSL.ps1
Last active September 2, 2021 09:14 — forked from noelbundick/LICENSE
Exclude WSL installations from Windows Defender realtime protection
############
# This script will add your WSL environments to the Windows Defender exclusion list so that
# realtime protection does not have an adverse effect on performance.
#
# You should be aware that this could make your system less secure. Use at your own risk.
# Note: This should be run from an administrative PowerShell prompt
############
# Find registered WSL environments
$wslPaths = (Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object { Get-ItemProperty $_.PSPath}).BasePath