Skip to content

Instantly share code, notes, and snippets.

Generate slimmed down WSL ubuntu image

example for ifuse

Note: If you are looking for a small-sized WSL rootfs, this is also recommended.
https://github.com/aont/wsl-rootfs
It is converted from a Docker image into a WSL rootfs.

Safe Package Removal Script with Protection Check

Purpose

This script automates the removal of packages listed in one file (to_be_removed.txt), but skips removal if doing so would also remove any "protected" packages listed in another file (keep.txt). It ensures important packages are not accidentally uninstalled.

Usage

  1. Prepare two text files:

Auto-Sort Downloads by Creation Month

Purpose

To automatically organize all files and folders in the Downloads directory into subfolders named by their creation year and month (format: YYYYMM).

Method

  • The script scans all items in the ~/Downloads folder.
  • If an item is not already in a correctly named folder for the current or past month, it is moved.

Accessing iPhone File System on Windows via WSL2 Using usbipd and ifuse

Adding memtest86+ to a Linux Live USB

Assuming you have already created an Ubuntu Live USB using Rufus, this guide explains how to add memtest86+ to the grub boot menu on that USB.

Item Value
Media Ubuntu 24.04 x86_64
Live USB Creation Method Rufus ISO mode

In Rufus ISO mode, a FAT partition is created on the USB, and the Ubuntu boot files and grub files are placed there.

How to convert Google Chrome's reading list to bookmarks in one go

If you want to organize your Google Chrome Reading List, this time we will introduce how to convert the entire Reading List into bookmarks at once. Using this method, you can save the hassle of creating bookmarks individually.

Step 1: Export Your Reading List Using Google Takeout

First, export your Reading List using Google Takeout.

  1. Go to Google Takeout.
  2. In the "Select data to include" section, click "Deselect all."

How to Convert .p12 to .pem with OpenSSL and Resolve RC2 Errors

If you're trying to convert a .p12 (PKCS#12) file to .pem format using OpenSSL but encounter an error related to RC2 encryption (e.g., RC2-40-CBC not supported), this guide walks you through both the conversion and the workaround.


🔄 .p12 to .pem Conversion

WebGL2 GPGPU Vector Addition

Purpose

This HTML+JavaScript program demonstrates how to perform GPU-accelerated vector addition using WebGL2. It leverages fragment shaders to add two vec4 RGBA32F textures on the GPU and retrieves the result via gl.readPixels.

Overview

  • Two input Float32Array vectors (dataB and dataC) are packed into RGBA32F textures.
  • A fragment shader computes the element-wise sum of the textures.