Useful Information

Useful Information

  1. About
  2. Frequently Used Prompt
  3. Software Development
    1. Security
    2. Miscellaneous
  4. Frequently Used Commands
    1. Git
  5. Windows
    1. Remove XBox
    2. Windows shortcuts
    3. Editing
  6. Visual Studio Code shortcuts
    1. Basic
    2. Navigation
    3. Debug
  7. Others

About

This page contains useful information to myself. It also serve as a testing page for this blog.

Frequently Used Prompt

Convert a string from blog title to Linux frendly filename.

1
convert string by replacing colon with dash, nonnalpha numeric with underscore. reduce repetiting underscore or dash to single underscore or dash:

Software Development

Security

Miscellaneous

Frequently Used Commands

  • Shutdown Windows immediately shutdown -r -t 0, useful when you remote to a Windows PC
  • Switch java version
1
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

Git

  • Undo (Not pushed)
    git reset --soft HEAD~
  • Deleting a remote branch
    git push [remote] --delete [branch]
    e.g., git push origin --delete feature/branch
  • Sync remote branch and delete remote non-existing local copy
    git fetch --prune
  • List the commit different between branches
    git rev-list [branch]...[another branch]
  • List the commit different between branches with arrow indicates which branch owns the commit
    git rev-list --left-right [branch]...[another branch]
  • List the commit of a branch is ahead/behind to a remote branch
    git rev-list [branch]...[remote]/[another branch]
  • Show the number of ahead of behind between branches
    git rev-list --left-right count [branch]...[another branch]
  • Update submodules with latest commit
    git submodule update --remote
  • Clean up orphan commits
    git gc --prune=now --aggressive

Windows

Remove XBox

  • Remove XBox with Powershell Get-ProvisionedAppxPackage -Online | Where-Object { $_.PackageName -match "xbox" } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
  • Check if any Xbox application is left dism /Online /Get-ProvisionedAppxPackages | Select-String PackageName | Select-String xbox

Windows shortcuts

Only those that are frequently used and easily forgotten are listed.

Move Window to another monitor⊞ Windows + ⇧ Shift + /
Switch to another desktop⊞ Windows + ⌃ Control + /
Task View⊞ Windows + Tab
Open Action Center⊞ Windows + A
Display/Hide Desktop⊞ Windows + D
Open File Explorer⊞ Windows + E
Quick Link Menu (System tools such as Event Viewer)⊞ Windows + X
Lock⊞ Windows + L

Editing

Switch Voice Typing⊞ Windows + H
Open Clipboard History⊞ Windows + ⌃ Control + V
Paste as plain text[1]⊞ Windows + V[2]
Capture screen and then OCR to clipboard[1:1]⊞ Windows + T[2:1]
Emoji⊞ Windows + .[2:2]

Visual Studio Code shortcuts

Only those that are frequently used and easily forgotten are listed. Refernce from https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf

Basic

User Settings⌃ Control + ,
Select all occurences of Find matchAlt + Enter
Quick Fix⌃ Control< + .
Ctrl+K Ctrl+X⌃ Control< + K ⌃ Control< + X
Go to Line…⌃ Control + G
Go to File…⌃ Control + P
Go to next error or warningF8
Focus into 1st, 2nd or 3rd… editor group⌃ Control + 1/2/3
Spit editor⌃ Control + </kbd>
Show integrated termina⌃ Control + `
Create new terminal⌃ Control + ⇧ Shift + `
Show Explorer / Toggle focus⌃ Control + ⇧ Shift + E
Show Search⌃ Control + ⇧ Shift + S
Show Source Control⌃ Control + ⇧ Shift + G
Show Debug⌃ Control + ⇧ Shift + D
Show Extension⌃ Control + ⇧ Shift + X
Replace in files⌃ Control + ⇧ Shift + H
Show Output panel⌃ Control + ⇧ Shift + U
Open Markdown preview to the side⌃ Control + K V

Debug

Toggle breakpoinF9
Start/ContinueF5
Step overF10
Step intoF11
Step out⇧ Shift + F11

Others


  1. Requires PowerToys ↩︎ ↩︎

  2. Customized shortcut ↩︎ ↩︎ ↩︎

Share