- Template name:
telegram.message
- Content:
{{- /* Telegram message to use: {{ template "telegram.message2" . }} */ -}} {{ define "__alerts_list" -}} {{ range . }} {{if ne (index .Labels "alertname") "" -}} {{ if eq .Status "firing" }}🔴{{ else }}🟢{{ end }} {{- if ne (index .Labels "severity") "" -}} <u><b>P{{ index .Labels "severity" }}</b></u> {{ end -}}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker logs $container 2>&1 | grep -P "\[(W|E)\]" | |
Example: | |
``` | |
04-16 22:04:19.222 [E](StatsApp) Animation has no fills: 1 in 0 | |
04-16 22:27:24.239 [E](StatsApp) Animation has no fills: 1 in 0 | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
assignee was currentUser() during (startOfDay(-2w), now()) AND updated >= startOfDay(-2w) AND ( resolutiondate is EMPTY OR resolutiondate >= startOfDay(-2w) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
import urllib.request | |
import time | |
import datetime | |
import subprocess | |
from html.parser import HTMLParser | |
from pprint import pprint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watch '{ nvidia-smi -q -d temperature | grep "GPU Current Temp"; sensors; }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, hmac, hashlib, time, requests, base64 | |
from requests.auth import AuthBase | |
class AbuCoins(AuthBase): | |
def __init__(self, api_key, secret_key, passphrase): | |
self.api_key = api_key | |
self.secret_key = secret_key | |
self.passphrase = passphrase | |
def __call__(self, request): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# git pre-commit hook that runs an clang-format stylecheck. | |
# Features: | |
# - abort commit when commit does not comply with the style guidelines | |
# - create a patch of the proposed style changes | |
# modifications for clang-format by [email protected] | |
# This file is part of a set of unofficial pre-commit hooks available | |
# at github. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
#include <cstring> | |
template<class T, class UnaryPredicate> | |
void reverseStringExtra(T& text, const UnaryPredicate& predicate) | |
{ | |
auto previousPivot = std::begin(text); | |
auto pivot = previousPivot; | |
while ((pivot = std::find_if(pivot, std::end(text), predicate)) != std::end(text)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# http://stackoverflow.com/a/35822173/1052261 | |
# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import os | |
import json | |
from shutil import copyfile | |
print('Number of arguments:', len(sys.argv), 'arguments.') | |
if len(sys.argv) < 3: |
NewerOlder