Posts

Showing posts from September, 2025

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[] ...

How to move WSL from one drive to another drive

Image
 Hi, let's see how to move the WSL from C Drive to D Drive. Run the below command to check the WSL list Create a new folder inside D Drive Run command  wsl --export Ubuntu D:\wsl\ubuntu.tar to export ubuntu as tar file to D drive Un register ubuntu, using command wsl --unregister Ubuntu Move the ubuntu from the tar file to D Drive Run the below command to set ubuntu as default distro Run the below command to view the list of wsl distro. Now, we can see the ext4 file is moved to the D Drive. Thank you!.