Skip to content

Instantly share code, notes, and snippets.

View igoforth's full-sized avatar

Ian Goforth igoforth

View GitHub Profile
@igoforth
igoforth / convert.py
Last active June 9, 2023 17:25
Convert doc to docx for privateGPT
# C:\"Program Files"\LibreOffice\program\soffice.exe --headless --convert-to docx --outdir out in\{filename}
# structure:
# .
# out\
# in\
# convert.py
import os
from multiprocessing import Pool, cpu_count
import subprocess
@igoforth
igoforth / vhd.ps1
Created January 4, 2023 20:15
Mounting VHD into WSL2
$number = $((Mount-DiskImage -ImagePath "D:\Data\VirtualBox VMs\WSL2 VHD\wsl2.vhdx" -PassThru | Get-Disk).Number)
$diskDrive = "\\.\PHYSICALDRIVE$number"
$bashDiskDrive = "PHYSICALDRIVE$number" + "p1"
wsl --mount $diskDrive -p 1
# remove previously created symlink
wsl rm -rf /mnt/wsl/vhd_data
# add new symlink
wsl ln -s /mnt/wsl/$bashDiskDrive /mnt/wsl/vhd_data
# Remember this line for our next part
# Start-Process "C:\Program Files\Docker\Docker\Docker Desktop.exe"