Skip to content

Instantly share code, notes, and snippets.

@marhensa
marhensa / gitpullall.ps1
Last active August 28, 2023 18:24
PowerShell - git pull for all directories (update all repository folders)
Get-ChildItem -Directory -Force -Recurse -Filter ".git" -Depth 1 | ForEach-Object {$currentLocation = Get-Location; Set-Location -Path $_.Parent.FullName; Write-Host $_.Parent.FullName; git pull; Set-Location -Path $currentLocation}
# make sure to run it on the folder that have all those repositories that needs to be updated
@marhensa
marhensa / gitpullall.sh
Last active August 28, 2023 18:24
Bash Linux - git pull for all directories (update all repository folders)
ls -R -d */.git | cut -d'.' -f1 | xargs -P10 -I{} git -C {} pull
# make sure to run it on the folder that have all those repositories that needs to be updated
@marhensa
marhensa / clearall.sh
Last active August 28, 2023 18:21
Bash Linux - clear screen and clear all bash histories and back to home folder
history -c && history -w && clear && cd ~
@marhensa
marhensa / compacting-vhdx
Last active August 28, 2023 18:34
Compacting Virtual HD of WSL (VHDX)
# Without Hyper-V Enabled
# Powershell (As Administrator)
wsl --shutdown
diskpart
# Diskpart Compacting Operations
select vdisk file="E:\LABS\DockerWSL\docker-desktop-data\ext4.vhdx"
attach vdisk readonly
compact vdisk
detach vdisk