Category Archives: Windows

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

Replace text in multiple files

Using find and sed a text in multiple files can be replaced using a one liner. If you have GIT bash you can do it in Windows too.

In the example below address of old.server.com will be replaced with new.server.com in all Web.config files.

find /c/inetpub/wwwroot -name "Web.config" -exec sed -i 's/old.server.com/new.server.com/g' {} +

Edit files in Altap Salamander using nano

This guide is meant for those who need to work in Windows from time-to-time and would like to have linux feeling.

Prerequisites

In Altap Salamander go to Configuration -> Editors.

Command"C:\Program Files\Git\bin\bash.exe"
Arguments--login -i -c 'nano "$(Name)"'
Initial Directory$(FullPath)

Remarks

--login -i is used to start interactive shell.

-c starts a command (nano …)

powercfg

Disable hibernation

powercfg /hibernate off

What sleep states are available?

powercfg /availablesleepstates

What device caused last wake?

powercfg /lastwake

What device blocks sleep?

powercfg /requests

# Ignore driver
powercfg /requestsoverride DRIVER "Realtek High Definition Audio" System

# View ignored drivers
powercfg /requestsoverride