Skip to content

Instantly share code, notes, and snippets.

View nibrobb's full-sized avatar
🇳🇴

Robin nibrobb

🇳🇴
View GitHub Profile
#!/usr/bin/env bash
## Prepend project management ticket id to the start of the commit message
# Extract the current branch name
BRANCH_NAME=$(git symbolic-ref --short HEAD)
# Identify the ticket number from the branch name
TICKET_ID=$(echo $BRANCH_NAME | grep -oE '[A-Z]+-[0-9]+' | head -n 1)
@nibrobb
nibrobb / update_libcuda_symlinks_v2.ps1
Last active September 3, 2024 20:02
WSL2: Update libcuda symbolic links. Now with self-elevation
# manfind - A simple tool for searching the man pages on Ubuntu
manfind() { man -k . | fzf | awk -F'[ ()]' '{print $3,$1}' | xargs man }
@nibrobb
nibrobb / self_elevating.ps1
Created November 30, 2023 18:00
Elevates the current script with Administrator privileges
# Self-elevate this PowerShell prompt
If (-not([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
# Relaunch as an elevated process:
Start-Process powershell.exe "-File", ('"{0}"' -f $MyInvocation.MyCommand.Path) -Verb RunAs
exit
}
@nibrobb
nibrobb / update_libcuda_symlinks.ps1
Last active September 3, 2024 19:31
WSL2: restores the symbolic links to libcuda.so that break when Nvidia GPU drivers are updated
@nibrobb
nibrobb / ignore_extensionless.gitignore
Last active September 22, 2023 18:34
Gitignore config for excluding files without file-extension
# Ignore all files without extention
*
!/**/
!*.*