Skip to content

Instantly share code, notes, and snippets.

@leimingyu
Last active March 25, 2024 20:00
Show Gist options
  • Save leimingyu/94314d2dc73f8067805adf31b62f4d47 to your computer and use it in GitHub Desktop.
Save leimingyu/94314d2dc73f8067805adf31b62f4d47 to your computer and use it in GitHub Desktop.
windows_NittyGritty_configurations

Tools for windows

PowerShell

  1. Upgrade current version open a powershell , run the following cmd
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Preview"
  1. Change the default login location
  • open pwoershell as admin, run the following command in the terminal
PS> $PROFILE | fl -Force
  • edit the target profile.ps1, my target is "C:\Users" , restart to check
Set-location C:\Users

reference: https://blog.matrixpost.net/set-powershells-default-working-directory/

[Error] profile.ps1 cannot be loaded because running scripts is disabled on this system error check this link: https://www.sharepointdiary.com/2014/03/fix-for-powershell-script-cannot-be-loaded-because-running-scripts-is-disabled-on-this-system.html

  1. create alias
notepad $PROFILE

For example, I created cd2 to go 2 folders upwards. Add the following lines to the powershell profile.

function cd2up { cd ../../ }
new-alias cd2 cd2up 
  1. Upgrade

Type the following command in the pwsh window to check the current version

$PSversionTable

For a new release, you will need to go to official website to find the right installer for your system (in my case, it is on github https://github.com/PowerShell/PowerShell/releases) On windows, I use msi file.

Add path to the system PATH

Sometimes, you download a portable program, but you want to run the exe system wide without typing the path first. You can add the program path to the system PATH. Below is the process. ``` System -> Advanced system settings -> Under "Advanced" tab, click "Environment Variables" -> System variables -> edit "Path" ```

Remote Desktop Access

Allow save credentials for remote desktop access

reference : https://theitbros.com/enable-saved-credentials-usage-rdp/

VS Code

compare two files

select two files, right click, "Compare Selected"

Miniconda

For python development, you can download miniconda for free.

On windows, you will need to run "Anaconda Powershell Prompt" to install packages.

To install jupyter notebook, if you have http000 issue, try the following command.

conda config --set ssl_verify no

check this post for more details.

install some packages

conda install numpy scikit-learn pandas matplotlib seaborn
conda install pytorch torchvision -c pytorch
conda install scikit-image

WSL

open command prompt as admin

check avail linux distro

wsl.exe --list --online

set use v2

wsl --set-default-version 2

install linux

wsl.exe --install -d <LinuxName>

update

sudo apt update
sudo apt upgrade
sudo apt install build-essential

Noted that, WSL mounts the local drive at /mnt/ folder in your Linux distros.

You drive C will be mounted under /mnt/c/

Nice Tricks

Split desktop into different windows

Make sure "multitasking settings"-> snap windows is turned on.

You can use window key + up/down to split desktop into multiple windows.

Create multiple virtual desktop

On windows10/1, use win + tab to create a virutal desktop

To switch, press win + ctrl + left/right arrow

Fix timezone automatic sync issue

Open 'services', select 'Auto Time Zone Updater', right click properties, choose 'Automatic' for startup type, and save the setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment