Skip to content

Instantly share code, notes, and snippets.

Github SSH Setup for Windows

Generating a new SSH key

To generate a new ssh key with the Ed25519 algorithm as recommended in the GitHub Docs paste the following powershell commmand:

> ssh-keygen -t ed25519 -C "comment of your choice"
@MarcHeiden
MarcHeiden / restart_windows_explorer.bat
Created February 5, 2022 16:37
batch script to restart the windows explorer
taskkill /f /IM explorer.exe
start explorer.exe
exit

Check Checksum with Powershell

Use the following powershell command to check if the SHA256 hashes match:

> IF(Select-String "Path to textfile with checksums" -Pattern (Get-FileHash "Path of executable" -Algorithm SHA256).hash){Write-Host "Check PASSED"}Else{Write-Host "Check FAILED"}

Upgrade all outdated pip packages with powershell

Use the following powershell command to upgrade all outdated pip packages:

> pip list -o | %{pip install -U $_.split(" ")[0]}
@MarcHeiden
MarcHeiden / !ColorOne.md
Created February 7, 2022 15:07
My current terminal color scheme

ColorOne

Git Cheatsheet

Command Description
git config --get-regexp user list user credentials
git config --add user.name set new local username

Print linux shell colors

for code in {000..255}
do
    print -P -- "$code: %F{$code}Color%f"
done

Docker Essentials

> docker

> docker [COMMAND]

Comands

@MarcHeiden
MarcHeiden / checkout-all-remote-branches-locally.ps1
Last active August 25, 2022 18:22
Checkout all remote git branches locally
$localBranches = [System.Collections.ArrayList]@()
$remoteBranches = [System.Collections.ArrayList]@()
git branch -r | % { if (!($_.split("/")[1].contains("HEAD")) -and !($_.split("/")[1].contains("main"))) {
$localBranches.Add($_.split("/")[1])
$remoteBranches.Add($_)
} }
$index = 0
foreach ($branch in $localBranches) {