Skip to content

Instantly share code, notes, and snippets.

View adivinho's full-sized avatar
🔨

Vadim Yalovets adivinho

🔨
View GitHub Profile
#!/bin/bash
while [ "$1" != "" ]; do
OBJECTS=$OBJECTS" "$1
shift
done
du -sb $OBJECTS | sed -ne 's/^\([0-9]\+\)\t\(.*\)$/node_fs_object_size_bytes{object="\2"} \1/p' >> /tmp/object_size.prom.$$ && mv /tmp/object_size.prom.$$ /tmp/object_size.prom
#!/bin/bash
echo "--------------------------------------------------"
echo " This is simple script for creating crontab tasks"
echo " that will collect metrics into files."
echo
echo " Notice: Information will be collected each minute"
echo "---------------------------------------------------"
echo
set COUNTER = 0
### Keybase proof
I hereby claim:
* I am adivinho on github.
* I am metralhadora (https://keybase.io/metralhadora) on keybase.
* I have a public key ASAVOZVERjoQW7TV_kw016yj64uf3lyz9_Jzd4Kt6-53Xwo
To claim this, I am signing this object:
@adivinho
adivinho / gist:bb28bf605472d99a7028baf4e3a570dc
Created April 17, 2018 18:54 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@adivinho
adivinho / grafana_dashboards_backup.sh
Created February 20, 2018 08:54 — forked from devcfgc/grafana_dashboards_backup.sh
backup grafana dashboard templates
#!/usr/bin/env bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
KEY=<api_token_key>
HOST="http://localhost:3000"
if [ ! -d $SCRIPT_DIR/dashboards ] ; then
mkdir -p $SCRIPT_DIR/dashboards
fi