Skip to content

Instantly share code, notes, and snippets.

@gafda
gafda / .gitconfig
Last active April 19, 2024 13:57
GIT Config file in windows format
[user]
name = <first> <last name>
email = <my-email>@<corp>
signingKey = ssh-ed25519 mYaWsOmEsUpErKey <my-email>@<corp>
[alias]
st = status
ls = log --pretty=format:'%C(yellow)%h%Creset %s %Cgreen(%cr)%\Creset %Cred%d%Creset' --abbrev-commit --date=relative
tl = log --tags --simplify-by-decoration --pretty='format:%ai %d'
tree1 = log --graph --full-history --all --color --date=short --pretty=format:'%Cred%x09%h %Creset%ad%C(bold yellow)%d %C(dim cyan) %s %C(reset)(%an)%Creset'
tree2 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
@gafda
gafda / update-scoop.ps1
Created March 12, 2024 13:42
Scoop Updater script for Powershell Core
# Scoop update & cleaner
scoop update
scoop update *
scoop cleanup *
scoop cache rm *
@gafda
gafda / Microsoft.PowerShell_profile.ps1
Created March 12, 2024 13:40
Windows 10+ / PowerShell Core initializer
# List of environment variables in Windows 10/11:
# %ALLUSERSPROFILE% – C:\ProgramData
# %APPDATA% – C:\Users\<username>\AppData\Roaming
# %CD% – Typing in this command will give you the current directory you are working in.
# %CMDCMDLINE% – Outputs command line used to launch the current Command Prompt session. (Command Prompt.)
# %CMDEXTVERSION% – This variable expands to the version of the command-line extensions.
# %COMMONPRGRAMW6432% – C:\Program Files\Common Files
# %COMMONPROGRAMFILES% – C:\Program Files\Common Files
# %COMMONPROGRAMFILES(x86)% – C:\Program Files (x86)\Common Files
# %COMPUTERNAME% -Outputs the system name.
@gafda
gafda / wsl-setup.sh
Last active April 24, 2024 11:24
WSL2 Startup process
#!/bin/bash
# Install WSL Ubuntu: wsl --install -d Ubuntu-22.04
# Stop WSL Ubuntu: wsl --shutdown Ubuntu-22.04
# Uninstall WSL Ubuntu: wsl --unregister Ubuntu-22.04
# List all WSL images: wsl -l -v
DISTRO=ubuntu2204
architecture=$(uname -m)