Skip to content

Instantly share code, notes, and snippets.

View renkin's full-sized avatar

René Kießig renkin

  • René Kießig Digitaldienstleistungen
  • Jena, Germany
View GitHub Profile
@renkin
renkin / KeePass_URL_Overrides_for_MobaXterm.bat
Created January 4, 2018 16:12
KeePass URL Overrides for SSH Scheme using MobaXterm
cmd://"C:\Program Files (x86)\Mobatek\MobaXterm\MobaXterm.exe" -newtab "ssh {USERNAME}@{URL:RMVSCM}"
@renkin
renkin / PlayAlarm.bat
Last active February 16, 2018 14:27
Powershell command for playing an alam sound from the console to e.g. be apended to a command pipe to know when it's ready
# Simple
powershell -c '(New-Object Media.SoundPlayer "C:\Windows\Media\alarm01.wav").PlaySync();'
# As alias:
alias play_sound='powershell -c "(New-Object Media.SoundPlayer \"C:\Windows\Media\alarm01.wav\").PlaySync();"'
play_sound
@renkin
renkin / grepForWindowsLinebreak.sh
Last active February 28, 2018 10:44
Search for windows style line breaks
# Only search
grep -rIUl --exclude-dir=modules $(printf '\r') *
# Search and fix
grep -rIUl --exclude-dir=modules $(printf '\r') * | xargs dos2unix
# Remove e.g. large files
git filter-branch prune-empty -index-filter "git rm -cached -f -ignore-unmatch TWUndDieWeihnachtsmaenner.mpg" -all
# Edit commit message of the last commit
git commit --amend
# Modify last or one of the last 3 commits or only their commit messages
git rebase -i HEAD~3
# Merge current staging area content with last commit
# Identity
git config --global user.name "Max Mustermann"
git config --global user.email "[email protected]"
git config --global user.signingkey 12345678
# Line break handling
# See https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration
git config --global core.autocrlf input
# KDiff3 as diff and merge tool
@renkin
renkin / reset_DNS_cache
Last active May 8, 2020 07:32
Reset DNS cache in Windows
# Empty DNS cache, so it is newly filled
ipconfig /flushdns
# Completely renew IP configuration
ipconfig /renew
# Check a route
tracert <host/IP>
@renkin
renkin / rsync.sh
Created July 18, 2020 18:40
RSync example
rsync -v -e ssh -r --progress rene@remote:~/Music .
@renkin
renkin / gitOnSubFolders.sh
Last active December 16, 2021 00:42
Sometimes you have a folder full of Git repositories and have to update all etc.
#!/bin/bash
# Parameter 1 ist ausgeführter Git Befehl, z.B. pull
find . -maxdepth 1 -type d -path '*/[^\.]*' -not -path '*/target' -not -path '*/src' -printf '\n\n************************\n%p\n************************\n\n' -exec git -C {} fetch --all --tags --prune --progress \; -exec git -C {} status \; -exec git -C {} "$1" \;
@renkin
renkin / gitMergeLatestIntoCurrentBranch.sh
Last active December 16, 2021 00:41
Update current branch from branch "develop"
#!/bin/bash
MAIN_BRANCH=${1:-develop}
echo
echo "Fetching..."
git fe
echo
echo "Switching to $MAIN_BRANCH..."
@renkin
renkin / gitDeleteLocalOrphanedBranches.sh
Last active January 21, 2025 09:19
Update branch "develop" and delete local orphaned branches
#!/bin/bash
MAIN_BRANCH=${1:-develop}
echo
echo "Fetching..."
git fe
echo
echo "Switching to $MAIN_BRANCH..."