Skip to content

Instantly share code, notes, and snippets.

View deniszh's full-sized avatar

Denis Zhdanov deniszh

View GitHub Profile
@deniszh
deniszh / Dockerfile
Last active November 24, 2022 21:51
graphite-irondb Dockerfile for python3
ARG BASEIMAGE=alpine:3.15
FROM $BASEIMAGE as base
LABEL maintainer="Denys Zhdanov <[email protected]>"
LABEL org.opencontainers.image.source https://github.com/graphite-project/docker-graphite-statsd
RUN true \
&& apk add --update --no-cache \
cairo \
cairo-dev \
findutils \
@deniszh
deniszh / targetsContext2.patch
Created October 25, 2021 19:23
Patch for populating targets in graphite-web context
--- views.py.bak 2021-10-25 21:19:07.891661700 +0200
+++ views.py 2021-10-25 21:21:17.093932100 +0200
@@ -74,6 +74,8 @@
'xFilesFactor' : requestOptions['xFilesFactor'],
'maxDataPoints' : requestOptions.get('maxDataPoints', None),
'targets': requestOptions['targets'],
+ 'maxStep': requestOptions.get('maxStep', None),
+ 'targets_serialized': requestOptions.get('targets_serialized', None),
}
data = requestContext['data']
@deniszh
deniszh / targetsContext1.patch
Created October 16, 2021 13:28
Patch for populating targets in graphite-web context
--- /opt/graphite/webapp/graphite/render/views.py.bak 2021-10-07 19:04:25.052907254 +0000
+++ /opt/graphite/webapp/graphite/render/views.py 2021-10-13 20:11:51.136487024 +0000
@@ -73,6 +73,8 @@
'prefetched' : {},
'xFilesFactor' : requestOptions['xFilesFactor'],
'maxDataPoints' : requestOptions.get('maxDataPoints', None),
+ 'maxStep': requestOptions.get('maxStep', None),
+ 'targets_serialized': requestOptions.get('targets_serialized', None),
}
data = requestContext['data']
@deniszh
deniszh / compressPeriodicGaps.patch
Last active October 13, 2021 10:25
compressPeriodicGaps.patch
--- functions.py.bak
+++ functions.py
@@ -151,6 +151,41 @@
return (seriesList)
+def _compressPeriodicGaps(series):
+ # removing periodic gaps, using summarize(seriesList, '<desired step>', 'last')
+ # but trying to auto detect step by first three existing values
+ consolidate = series.consolidationFunc
@deniszh
deniszh / compressgaps.patch
Created September 22, 2021 21:27
compressgaps.patch
--- functions.py.bak
+++ functions.py
@@ -2139,6 +2139,8 @@
"""
results = []
for series in seriesList:
+ # applying _compressGaps() first
+ series = _compressGaps(series)
newValues = []
prev = None
@deniszh
deniszh / salt-2019.2-security.patch
Last active May 6, 2020 11:07
Fixes for CVE-2020-11651 and CVE-2020-11652 for Salt 2019.2 branch
# use https://github.com/deniszh/salt-security-backports instead
@deniszh
deniszh / salt-2015.5-security.patch
Last active May 6, 2020 11:07
Fixes for CVE-2020-11651 and CVE-2020-11652 for Salt 2015.5 branch
# use https://github.com/deniszh/salt-security-backports instead
@deniszh
deniszh / CVE-2020-11651-11652.sls
Created April 30, 2020 11:58
How to patch Salt by salt
{% if grains.saltversion == "2016.11.6" %}
# Just in case there is no patch command installed
patch:
pkg.installed
# We use directory name here (saltpath) to apply patches that touch multiple files
saltmaster_security_patch:
file.patch:
- name: '{{ grains.saltpath }}'
@deniszh
deniszh / salt-2016.11-security.patch
Last active May 6, 2020 11:07
Fixes for CVE-2020-11651 and CVE-2020-11652 for Salt 2016.11 branch
# use https://github.com/deniszh/salt-security-backports instead
counter processes_oom_killed_total
counter processes_oom_killed_by_name by label
/Killed process (\d+) \((\S+)\) total-vm:\d+kB, anon-rss:\d+kB, file-rss:\d+kB$/ {
processes_oom_killed_total++
processes_oom_killed_by_name[$2]++
}