How To wiki - youdar/How-to GitHub Wiki

General Widows tips and tricks

Clean git pull

git checkout <branch>
git reset --hard
git clean -dfx
git pull

Adding shortcut to start menu

You might have noticed that if you right-click on shortcuts, you don't have to option to pin them to the start menu. To overcome this do:

  1. open file explorer and go to %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\
  2. drag the shortcut you want to pin into the Start Menu folder

That is it...

Setup program to start when windows starts

(Win 8.1)

  1. open the file explorer and go to %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  2. paste a shortcut of the program you want to run at start-up to that folder

Create aliases in windows

  1. create a file %userprofile%\aliases.cmd
  2. in that file you can add aliases as follow:
@echo off
doskey python3 = c:\python34\python.exe $* 

for PowerShell this will look like

@echo off
New-Alias python3 c:\python34\python.exe
  1. click the [Windows] button
  2. type "cmd", right-click on "command-prompt" and select [open file location]
  3. right-click on the "command prompt" shortcut and select [properties]
  4. change the target to %windir%\system32\cmd.exe /k "%userprofile%\aliases.cmd"

Simple way to create a temp file name in Python

from uuid import uuid4

tmp_path = '/home/some_path/temp_file_name_'
temp_file_name = tmp_path + str(uuid4())
⚠️ **GitHub.com Fallback** ⚠️