Posts

How to reclaim the space in WSL after folder deletion

Image
 Deleting files inside WSL is like throwing trash away inside a house—the house (the .vhdx file) doesn't actually get smaller on the outside until you "move the walls back in." To reclaim that space on your C: drive immediately , follow these steps. In powershell run the below command wsl --shutdown Restart your windows system. Run below command , replace the DistroName with your WSL Distro Name. wsl --manage <DistroName> --set-sparse true How to find the Distro Name: Run the below command in Powershell wsl -l -v Normally ubuntu will be the distro name.

How to know the path of ext4.vhdx in windows

Image
 Finding this file can be a bit of a scavenger hunt because the folder names are often long strings of random characters. The easiest way to find it is to use PowerShell to tell you exactly where it's hiding. Method 1: The "Automatic" Way (PowerShell) Copy and paste this command into a PowerShell window. It will spit out the exact path to your virtual disk: In powershell, run the command  Get-ChildItem -Path "$env:LOCALAPPDATA\Packages" -Filter "ext4.vhdx" -Recurse -ErrorAction SilentlyContinue | Select-Object FullName, @{Name="SizeGB";Expression={$_.Length / 1GB}}

How to see exactly which subfolders are the "space hogs" inside a specific directory in WSL

Image
 If you want to navigate through your folders and delete things on the fly, ncdu is the gold standard for WSL users. It feels like a simplified, terminal version of WizTree. Install it:  sudo apt update && sudo apt install ncdu Run it on your suspect folder: ncdu /path/to/your/folder If we wants to check in root of the repo, run below command ncdu ~ You can see the space of each folder like this.

Generate a self-signed certificate (for testing/development)

Image
Use OpenSSL to create a self-signed certificate: Step 1: Install OpenSSL (if not already installed)  # On Ubuntu/WSL sudo apt-get update sudo apt-get install openssl Step 2: Generate the certificate # Create certs directory mkdir -p certs cd certs # Generate a private key and certificate openssl req -x509 -newkey rsa:2048 -keyout signature-key.pem -out signature-cert.pem -days 365 -nodes # Convert to PKCS#12 format (.p12) openssl pkcs12 -export -out signature-cert.p12 -inkey signature-key.pem -in signature-cert.pem -name "Invoice Signing Certificate" When prompted: Enter a password for the .p12 file (To use in env variable) Fill in certificate details (or press Enter to skip) This will generate the certs file for you. Thank you.

How to connect to postgres database in activepieces

Image
In this post, we will see how to connect to postgres database in local activepieces development environment.  Add the Below mentioned env variables  Follow below link to install and setup postgres  https://simplelinuxlearnings.blogspot.com/2025/10/in-wsl-how-to-create-database-update.html Create a new database named activepieces like below. Now, start the application using npm start, your postgres  database should be utilized by activepieces.

In WSL How to create database , Update Password and connect the database in any application

Image
  Make sure, we have postgres installed, run below query to verify that. Run the below command to install  pg_ctlcluster utility command : sudo apt install postgresql postgresql-contrib Run the below command to start the postgresql manually Run the below command to postgres user sudo -i -u postgres psql Run command createdb my_database to create a new database Run the command psql -l to list the list of database  From your current prompt ( postgres@...$ ), enter the PostgreSQL shell: psql Now, paste this command to change the password for postgres user  ALTER USER postgres WITH PASSWORD 'your_secure_password'; Now we can see like below Type \q to exits the PostgreSQL shell and brings you back to the Linux terminal  I installed the below extension in visual studio Select postgresSQL and provide the database details with password and click on Connect button. Now, we can see the database details inside visual studio Lets Thank you!

How to generate a secure value for JWT_SECRET

How to Create a High-Strength JWT_SECRET A secure secret must be long, random, and unpredictable . Simple phrases, dictionary words, or short strings are easily brute-forced or cracked using common tables. A good secret should be at least 32 bytes long (which results in a longer Base64 string) and generated using a cryptographically secure pseudo-random number generator (CSPRNG). Generating a Strong Secret Use your operating system's built-in cryptographic tools to generate the string. On Linux/macOS (Bash): The openssl rand command is a reliable way to generate a strong random string. The -base64 32 flag generates 32 cryptographically random bytes and encodes them in Base64 for safe use in environment files. Bash openssl rand -base64 32 On Windows (PowerShell): PowerShell offers a secure way to generate byte arrays using the .NET Framework's RNGCryptoServiceProvider . This ensures the randomness is suitable for cryptographic purposes. PowerShell $bytes=New-Object Byte[] ...