Compact a WSL distro's virtual disk to reclaim unused storage space.
WSL's virtual disk grows when needed but doesn't shrink by itself. Here is how to reclaim the unused space. This can sometimes free hundreds of GBs for use on Windows.
| /* ==UserStyle== | |
| @name Virtana-Zenoss Style Tweaks [willpresley] | |
| @version 1.0.0 | |
| @author WillPresley | |
| ==/UserStyle== */ | |
| @-moz-document url-prefix("https://ohioit.zenoss.io/cz0/zport/dmd/Events/"), url-prefix("https://ohioit.virtana.ai/cz0/zport/dmd/Events/") { | |
| /* ============================================================ | |
| Dark-theme header logo override | |
| ------------------------------------------------------------ |
| <?php | |
| /** | |
| * Plugin Name: Multisite — Local Password Reset | |
| * Plugin URI: https://gist.github.com/WillPresley/6c4d736158f9988fe5298b7fbf03d9cf | |
| * Description: Keep users on their subsite for the entire password reset flow in WP Multisite (lost password, reset links in emails, titles, etc). | |
| * Version: 1.2.0 | |
| * Author: Will Presley | |
| * Author URI: https://willpresley.com | |
| * License: MIT | |
| * |
By Obbe Vermeij
What life was like inside Rockstar North.
Original source: insiderockstarnorth.blogspot.com | Archive.org
Articles preserved as posted
| # Backup WSL2 virtual disks using native functions and compress them using 7zip | |
| ## Will Presley, 2020 | |
| ## willpresley.com | |
| #### http://mats.gardstad.se/matscodemix/2009/02/05/calling-7-zip-from-powershell/ | |
| # Alias for 7-zip | |
| if (-not (test-path "$env:ProgramFiles\7-Zip\7z.exe")) {throw "$env:ProgramFiles\7-Zip\7z.exe needed"} | |
| set-alias sz "$env:ProgramFiles\7-Zip\7z.exe" | |
| #### Alternative native PS 7-zip: https://www.sans.org/blog/powershell-7-zip-module-versus-compress-archive-with-encryption/ |
| /* PrivateBin Bootstrap CSS Changes -- Will Presley -- https://gist.github.com/WillPresley/159b1027010f88eb3e2b026c8c66756e */ | |
| footer h4 small { display: none; } | |
| #aboutbox { font-size: 12px; text-align: right; line-height: 1.15; } | |
| @media (min-width: 992px) { #aboutbox { padding-left: 75px; } } | |
| @media (min-width: 1280px) { #aboutbox { padding-left: 200px; padding-left: 12vw; } } |
| /* Monitorr minimal - WillPresley fork - https://gist.github.com/WillPresley/b80072238c665ba1170e03cc092c0ab6 */ | |
| body.embedded-view { | |
| background: transparent !important; | |
| margin-bottom: 0 !important; | |
| } | |
| body.embedded-view #footer {display:none !important;} | |
| #headermin { | |
| margin-top: 0; |
| /* GLOBAL/Interface */ | |
| .flux .item.website > a { margin-right: 10px; } | |
| /* All Feeds */ | |
| .content blockquote p { margin: 1em; } | |
| /* Android Police */ | |
| div[data-feed="3"] .content header, | |
| div[data-feed="3"] .content header ~ div:first-of-type, | |
| div[data-feed="3"] .content header ~ div:nth-last-child(3) { display: none; } |
| # folders and files to be ignored by git | |
| ############ | |
| ## Bones | |
| ############ | |
| Bones.esproj/ | |
| ############ | |
| ## IDEs |
| @echo off | |
| set "Server=192.168.50.125" | |
| set "RetryCount=0" | |
| :CheckServer | |
| rem Ping server only once with a time limit of 1000 ms. | |
| %SystemRoot%\System32\ping.exe -n 1 -w 1000 %Server% >nul | |
| if not errorlevel 1 goto MapDrive | |
| rem Connection to server is not yet established. Give up after 30 seconds |