Skip to content

Instantly share code, notes, and snippets.

View nevmerzhitsky's full-sized avatar
🪀

Sergey Nevmerzhitsky nevmerzhitsky

🪀
  • 08:09 (UTC +05:00)
View GitHub Profile
@nevmerzhitsky
nevmerzhitsky / .php_cs.dist.php
Last active March 25, 2021 12:14
PHP CS Fixer config for PHP 7.3+ compatible with PSR-12
<?php
$rules = [
'@PSR12' => true,
// There is a lot of opinionated PSR-12 extending rules below, they all don't break PSR-12.
// Each risky rule marked by the comment.
// @array_notation
'array_syntax' => [
@nevmerzhitsky
nevmerzhitsky / vhdx.txt
Last active May 10, 2021 09:43 — forked from onomatopellan/vhdx.txt
How to automount an external vhdx file in WSL2
1. Ubuntu WSL2 must be already installed in C: system drive and user should be able to call windows binaries like wsl.exe from bash.
2. We will install Alpine WSL2 distro in an external partition/disk:
Download an Alpine ZIP file from here:
https://github.com/yuk7/AlpineWSL/releases/
Extract the files in an external partition/disk. (for example D:\Alpine)
Make sure WSL2 is enabled by default (wsl.exe --set-default-version 2)
Inside the Alpine folder run `winpty Alpine.exe` to install the Distro. An ext4.vhdx file will be created in that same folder.
@nevmerzhitsky
nevmerzhitsky / script.ps1
Last active June 16, 2024 08:07
Shrink a WSL2 Virtual Disk
# Link https://stephenreescarter.net/how-to-shrink-a-wsl2-virtual-disk/
wsl -l -v
wsl --shutdown
diskpart
select vdisk file="D:\WSL\...\ext4.vhdx"
attach vdisk readonly
compact vdisk
detach vdisk