Turn On/Off display monitor windows API

To turn off monitor in Windows, SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM)2) is most widely used.
Instead, we can use low-level monitor configuration functions.

BitLocker with CMD

To lock the volume,
C:\>manage-bde -lock [volume]

To unlock the volume,
C:\>manage-bde -unlock -pw [volume]

How to prevent resizing terminal when using screen

# Long time I had this in my private screenrc file. But many people
# seem to want it (jw):
# we do not want the width to change to 80 characters on startup:
# on suns, /etc/termcap has :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:
#termcap xterm ‘is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l’
#terminfo xterm ‘is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l’

in /etc/screenrc

Turn on/off mobile hotspot on windows 10 via powershell

To turn on mobile hotspot:
PS C:\> [Windows.Networking.NetworkOperators.NetworkOperatorTetheringManager,Windows.Networking.NetworkOperators,ContentType=WindowsRuntime]::CreateFromConnectionProfile([Windows.Networking.Connectivity.NetworkInformation,Windows.Networking.Connectivity,ContentType=WindowsRuntime]::GetInternetConnectionProfile()).StartTetheringAsync()↵


To turn off mobile hotspot:
PS C:\> [Windows.Networking.NetworkOperators.NetworkOperatorTetheringManager,Windows.Networking.NetworkOperators,ContentType=WindowsRuntime]::CreateFromConnectionProfile([Windows.Networking.Connectivity.NetworkInformation,Windows.Networking.Connectivity,ContentType=WindowsRuntime]::GetInternetConnectionProfile()).StopTetheringAsync()↵

Windows Equivalents for Chown and Chmod

TAKEOWN [/S system [/U username [/P [password]]]] /F filename [/A] [/R [/D prompt]]

Description:
This tool allows an administrator to recover access to a file that
was denied by re-assigning file ownership.

Parameter List:
/F – Specifies the filename or directory name pattern.
/A – Gives ownership to the administrators group instead of the current user.
/R – Recurse: instructs tool to operate on files in specified directory and all subdirectories.

Examples:
TAKEOWN /?
TAKEOWN /F * /R /A


ICACLS name [/grant[:r] Sid:perm[…]]

Description:
Sid:perm grants the specified user access rights.

Parameter List:
/T  – Recurse

Permission List:
N – no access
F – full access
M – modify access
RX – read and execute access
R – read-only access
W – write-only access
D – delete access

Examples:
ICACLS /?
ICACLS * /grant “Administrators:(F)” /T