Skip to content

Instantly share code, notes, and snippets.

View mezorian's full-sized avatar

Mezorian mezorian

  • inc-ffh.solutions
  • Planet Earh
View GitHub Profile
@mezorian
mezorian / PushBigGitCommitByCommit.sh
Last active May 26, 2024 17:26
Push big git repository commit by commit to not run into timeouts
#!/bin/bash.sh
#
# push a big git repository commit by commit to not run into timeouts
# this is for example needed if you have some bigger binary files inside the repository and
# run into timeouts while pushing the repo into a new remote url.
#
# to run this script please ensure that:
# 1. you are able to push to your remote url via ssh (without password authentication)
# 2. you put this file into the directory above your git repo and open a bash inside your repo's directory
# 3. this file is executable, if you are unsure about this run:
@mezorian
mezorian / ExtractStringBetweenStrings.sh
Created August 24, 2019 07:42
Extract a string between two strings with bash
#!/bin/bash
strindex() {
x="${1%%$2*}"
[[ "$x" = "$1" ]] && echo -1 || echo "${#x}"
}
function extractStringBetweenStrings() {
# get parameters
string="$1"