Skip to content

Instantly share code, notes, and snippets.

View timeuz's full-sized avatar
๐Ÿ˜

timEU timeuz

๐Ÿ˜
View GitHub Profile
@jidckii
jidckii / alertmanager.tmpl
Created April 5, 2023 14:08
Alertmanager telegram template
{{ define "__yucca_text_alert_list" }}{{ range . }}
---
๐Ÿชช <b>{{ .Labels.alertname }}</b>
{{- if .Annotations.summary }}
๐Ÿ“ {{ .Annotations.summary }}{{ end }}
{{- if .Annotations.description }}
๐Ÿ“– {{ .Annotations.description }}{{ end }}
๐Ÿท Labels:
{{ range .Labels.SortedPairs }} <i>{{ .Name }}</i>: <code>{{ .Value }}</code>
{{ end }}{{ end }}
@realkarmakun
realkarmakun / grafana-alertmanager-telegram-template
Last active January 3, 2023 19:11
Grafana alertmanager Telegram Template. Just some Telegram template I use for my Grafana alerts
{{ define "TelegramAlert" }}
{{ if eq .Status "firing" }}๐Ÿ”ฅ<b>[FIRING {{end}}{{ if eq .Status "resolved" }}โœ…<b>[RESOLVED {{end}}ALERT]</b>
{{ range .Alerts -}}
๐Ÿ”Ž <b>Title:</b> <i>{{ .Annotations.title }}</i>
{{ if .Labels.severity }} ๐Ÿ“– <b>Status:</b> `{{ .Labels.severity }}`{{ end }}
๐Ÿท๏ธ <b>Labels:</b>
{{ range .Labels.SortedPairs }} ๐Ÿ”– <i><b>{{ .Name }}:</b> {{ .Value }}</i>
{{end}}
๐Ÿ“š <b>Description:</b> {{ .Annotations.description }}
{{ if gt (len .GeneratorURL) 0 }}๐Ÿ’ฅ <b>Source:</b> {{ .GeneratorURL }}{{ end }}
from flask import Flask, request, jsonify
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.mime.application import MIMEApplication
app = Flask(__name__)
def send_test_mail(body):
@danielalvarenga
danielalvarenga / terminal-colors-branch.sh
Last active May 1, 2025 21:57
Show branch in terminal Ubuntu
# Add in ~/.bashrc or ~/.bash_profile
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
RED="\[\033[01;31m\]"
YELLOW="\[\033[01;33m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
NO_COLOR="\[\033[00m\]"