Skip to content

Instantly share code, notes, and snippets.


Dmitry Verkhoturov paskal

View GitHub Profile
paskal /
Last active Sep 14, 2021
How to set up the Percona Monitoring and Management (PMM) v2 with docker-compose

Set up PMM Server v2

Let's start by creating entry for server in docker-compose.yaml:

version: '2'
# version 2 of docker-compose is not "old" version, it's the actual version,
# see below for explanation:
View resume.json
"meta": {
"theme": "kendall",
"canonical": ""
"basics": {
"name": "Dmitry Verkhoturov",
"label": "Senior Site Reliability Engineer",
"picture": "",
"email": "",
paskal /
Last active Jul 26, 2018
Recuresively resolve Zabbix user macro within string
import re
import logging
def expand_macro(zapi, itemid, hostid, macro):
"""Expand macro in passed string, recursively. Non-existent macro resolved to empty string.
# {$MACRO} resolves to "test macro in ${ENV} environment"
# {$ENV} resolves to "dev"
>>> print(expand_macro(zapi, 12345, 54321, "string with {$MACRO}"))
paskal / zabbix_find_unused_macroses.sql
Last active Jul 2, 2017
Find hosts\templates macroses, unused by items and triggers (including autodiscovery)
View zabbix_find_unused_macroses.sql
SELECT m.hostid,
FROM hostmacro AS m
NOT (SELECT count(*)
FROM functions AS f
JOIN items AS i ON i.itemid = f.itemid
WHERE i.hostid = m.hostid
AND f.parameter LIKE concat('%',m.macro,'%'))
#!/usr/bin/env python
# Copyright 2012 Konstantin Shcherban <>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
paskal / site.conf
Last active Aug 6, 2021 — forked from plentz/nginx.conf
Nginx configuration for best security and modest performance. Full info on
View site.conf
#
# latest version on
# security test score:
# your nginx version might not have all directives included, test this configuration before using in production against your nginx:
# $ nginx -c /etc/nginx/nginx.conf -t
server {
# public key, contains your public key and class 1 certificate, to create:
# (example for startssl)
# $ (cat & wget -O - | tee -a /etc/nginx/ssl/domain.pem > /dev/null