Skip to content

Instantly share code, notes, and snippets.

@AnmolTomer
Last active September 6, 2021 23:12
Show Gist options
  • Save AnmolTomer/4cb73b9cff734f41bcda5d1695ccc4cc to your computer and use it in GitHub Desktop.
Save AnmolTomer/4cb73b9cff734f41bcda5d1695ccc4cc to your computer and use it in GitHub Desktop.
WINDOWS 10 PS SNIPPETS
  1. GET DETAILS OF APPLICATION WITH PID RUNNING ON A SPECIFIC PORT

Replace 5500 with the port that you want to get info on.

  • Get-Process -Id (Get-NetTCPConnection -LocalPort 5500).OwningProcess Reference
  1. KILL TASK WITH SPECIFIC PID - WINDOWS 10
  • taskkill /F /PID 7644
  1. SHORTEN THE SYSTEM PATH VARIABLE IF YOU REACH 2047 LIMIT
  • Go to Environment Variables > Add following new variables in system section
    • x86 = %ProgramFiles(x86)%
    • x64 = %ProgramFiles%
    • windir = C:\WINDOWS
    • DSI = D:\Software\Installed
  • Now these can be used as %x86%\ %x64% %windir% %DSI% and can help to not reach the 2047 char limit in system path variables.
  • More on this here
  1. Make a python script run from anywhere in Windows. Follow Solution 1 Link

  2. Exclude files like config.py that hold your api secrets by doing following: https://stackoverflow.com/a/61711738/9719106

  3. Save terminal output to file and display too https://askubuntu.com/a/731237/788565

  4. Remove space from apk files on ubuntu rename 's/ /_/g' *.apk

  5. Install batch apks in one go using adb :alert: run from CMD for %e in (*.apk) do adb install %e Source, Mod apk source https://modwayne.com/

  6. VSCode Terminal Integrated Tabs Enable/Disable: https://code.visualstudio.com/updates/v1_56#_terminal-tabs

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