Skip to content

Instantly share code, notes, and snippets.

View hung1001's full-sized avatar
💭
I may be slow to respond.

Hưng Hoàng Văn hung1001

💭
I may be slow to respond.
View GitHub Profile

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
:: Made by Hoang Hung
@echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if "%errorlevel%" NEQ "0" (
echo: Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo: UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs" & exit
)
if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"
@echo off
color 0f
mode con cols=140 lines=30
Title Remove Provisioned Appx in Windows 10
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if "%errorlevel%" NEQ "0" (
echo: Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo: UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
[cmi]
namespace=urn:schemas-microsoft-com:unattend
ClientServerSplit=true
AnswerFileFormat=1
ServerDatacenterACorCore=P7CCN-72DMB-93C9B-C9PD7-379HK
EnterpriseNEval=MNXKQ-WY2CT-JWBJ2-T68TQ-YBH2V
ProfessionalSingleLanguage=G3KNM-CHG6T-R36X3-9QDG6-8M8K9
CoreSingleLanguage=BT79Q-G7N6G-PGBYW-4YWX6-6F4BT
Professional=VK7JG-NPHTM-C97JM-9MPGT-3V66T
ServerStorageStandard=VN8D3-PR82H-DB6BJ-J9P4M-92F6J