I’m recently working in Windows, so I take many notes about setting up the Windows environment.

More windows tips

Configuration

Look and feel

  • The Chinese characters are ugly in Telegram for Windows when using English locale. A simple fixing is set system region to Chinese and Telegram will choose the right Chinese font. If it is not acceptable to change the region, an alternative solution is using FontMod. When I test it, I have to replace DAOpenSansRegular and DAVazirRegular.

  • how to scale krita UI ?

    Uncheck Settings/Configure Krita/General/Window/Enable HiDPI support to rely on system scale setting.

Proxy

  • Using Scoop behind a proxy · lukesampson/scoop Wiki

    scoop config proxy [username:password@]host:port
    
  • Web authentication broker - UWP applications | Microsoft Docs

    Some UWP apps depend on AuthHost to connect services like Google. Nebo is an example. So it is not enough to add Nebo to the loopback exempt list, the AuthHost must be in the list as well to ensure Nebo using the system proxy.

    This article has listed the following commands, where I have modified a bit to make them work in PowerShell

    CheckNetIsolation.exe LoopbackExempt -a "-n=microsoft.windows.authhost.a.p_8wekyb3d8bbwe"
    CheckNetIsolation.exe LoopbackExempt -a "-n=microsoft.windows.authhost.sso.p_8wekyb3d8bbwe"
    CheckNetIsolation.exe LoopbackExempt -a "-n=microsoft.windows.authhost.sso.c_8wekyb3d8bbwe"
    

    But I failed using these commands. Instead I find the SID from registry HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Mappings. Search AuthHost inside it, and the directory name is the SID. The following command works for me

    CheckNetIsolation.exe loopbackexempt -a "-p=S-1-15-2-2750798217-1343590035-1234819260-1030354384-3318145141-3720257911-3461195215"
    

Productivity tips

Programming Environment

GPG and SSH security

  • Share SSH and GPG keys with WSL

    Since WSL2 can use Windows executable directly, the most straightforward way is just using the Windows counterparts.

  • I finally have a comfortable setup to use YubiKey in Windows for gpg signing and ssh authentication. I’ll write a post about it later. The following article helps me a lot: How to use GPG with YubiKey (bonus: WSL).

OpenSSH server

  • OpenSSH Server Configuration for Windows | Microsoft Docs

    The default shell is cmd, the following command sets the default shell to PowerShell instead

    New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force
    
  • Visual Studio Code Switch Azure Account - Concurrency

    Windows now has bundled OpenSSH server. But the key authorization requires strict restrictions on the authorized keys file permissions. It is not easy to make it right in Windows. I found the solution in this post. Pay attention that so administrator uses should use C:\ProgramData\ssh\administrators_authorized_keys save authorized public keys.

    $acl = Get-Acl C:\ProgramData\ssh\administrators_authorized_keys
    $acl.SetAccessRuleProtection($true, $false)
    $administratorsRule = New-Object system.security.accesscontrol.filesystemaccessrule("Administrators","FullControl","Allow")
    $systemRule = New-Object system.security.accesscontrol.filesystemaccessrule("SYSTEM","FullControl","Allow")
    $acl.SetAccessRule($administratorsRule)
    $acl.SetAccessRule($systemRule)
    $acl | Set-Acl
    

Tech

┌ Productivity

┌ Programming

┌ Linux

  • How to generate locale in Slitaz

    localedef -i ru_RU -c -f UTF-8 /usr/lib/locale/ru_RU.UTF-8
    
  • I use Fedora cloud version in WSL2 as the main distribution. By default it lacks the locale packages.

    sudo dnf install glibc-langpack-en
    
  • Network modes in Parallels Desktop for Mac

    The minimal distribution like Slitaz does not bundle the driver for vertio. The workaround is using the Intel (R) PRO/1000 MT network adapter first, install linux-kvm in Slitaz and then switch to vertio.

  • Patch for Kernel 5.6 | Parallels Forums

    The Fedora 32 kernel is too new to install Parallels Gust Tools. Apply the patch in this thread first.

┌ Blockchain

Non-tech

┌ Business

┌ History

Misc

Funny