Connect to macOS from Windows

I used to connect to MacOS remote desktop using RealVNC.

I create a local port forward:

ssh -L 25900:127.0.0.1:5900 username@MAC_IP

I was than able to connect using 127.0.0.1:25900. But that stopped working after macOS upgrade. I started getting Key Length Too Large error. RealVNC does not seem to fix it event in latest version 8.5.

So I was looking for alternative client that supports macOS username login. Most clients only seem to support password only login. What worked for me was gvncviewer in WSL. The only problem is that it does not seem to support port change, so I have to use 5900 instead of 25900 for local connection.

sudo apt install gvncviewer
ssh -L 5900:127.0.0.1:5900 username@MAC_IP
gvncviewer 127.0.0.1

Get list of uninstall strings for installed Windows applications using PowerShell

$paths = @(
    "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*",
    "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
    "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*"
)

Get-ItemProperty $paths -ErrorAction SilentlyContinue |
    Where-Object DisplayName |
    Select-Object DisplayName, UninstallString, QuietUninstallString |
    Format-List

Convert Windows 7 VM from VirtualBox to Hyper-V

I used qemu utils in WSL for the disk conversion:

sudo apt install qemu-utils
qemu-img convert -f vdi -O vhdx "Windows 7.vdi" "Windows 7.vhdx"

VM in Hyper-V has to be created as Generation 1 with disk in IDE controller. The problem is that VirtualBox uses SATA driver by default. So after VM started I got BSOD 0X0000007B. I had to load PCI driver after start of Windows. To do it I have used startup repair to get into the command prompt and executed the following commands. It assumes that the original Windows system disk is mounted as D:.

reg load HKLM\OFFLINE D:\Windows\System32\Config\SYSTEM

reg add "HKLM\OFFLINE\ControlSet001\Services\atapi" /v Start /t REG_DWORD /d 0 /f
reg add "HKLM\OFFLINE\ControlSet001\Services\intelide" /v Start /t REG_DWORD /d 0 /f

reg unload HKLM\OFFLINE

MacOS lock / unlock times

You can find lock / unlock times in log using terminal. The script below searches for records in last 8 hours, but you may change it using --last parameter. See lockunlock for details.

log show --last 8h --style syslog \
  --predicate 'process == "loginwindow"' | grep -iE "user is active, releasing the activity semaphore|going inactive, create activity semaphore"

iRedMail and Dovecot fulltext search

I already have quite a large mailbox and I started running into timeout issues when searching in Roundcube mail. AI gave me some instructions for installing the dovecot-fts-xapian plugin, but I kept encountering various errors:

Warning: FTS Xapian: missing configuration - Using default values
Warning: FTS Xapian: Memory too low (text) 'std::bad_alloc'

The problem was incomplete configuration, but the AI didn’t know what to do. I found the correct instructions on GitHub.

(...)
protocols = imap pop3 sieve lmtp

mail_plugins = (...) fts fts_xapian

plugin {
    fts = xapian
    fts_xapian = verbose=0

    fts_autoindex = yes
    fts_enforced = yes

    (...)
}

service indexer-worker {
    # Increase vsz_limit to 2GB or above.
    # Or 0 if you have rather large memory usable on your server, which is preferred for performance)
    vsz_limit = 2G
    # This one must be 0
    process_limit = 0
}
(...)