Skip to content

Instantly share code, notes, and snippets.

@cherti
cherti / switch_branch.sh
Created June 20, 2020 20:31
help switching a git repo's default branch from master to main
#!/bin/bash
# this script will assist you in migrating git-repositories from
# the primary branch 'master' to the primary branch 'main'.
# It currently works with only one remote (adjust accordingly if you
# have more than one), the name of which is taken as the first argument.
#
# Example: bash switch_branch.sh origin
#
# It will
@cherti
cherti / alert.sh
Created December 9, 2016 13:47
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",