Skip to content

Instantly share code, notes, and snippets.

View alexanderzobnin's full-sized avatar

Alexander Zobnin alexanderzobnin

View GitHub Profile
@alexanderzobnin
alexanderzobnin / Dockerfile-griddb
Created July 26, 2019 07:35
Dockerfile for deploying griddb
FROM ubuntu:xenial
ENV GRIDDB_VERSION="4.2.1"
ENV DOWNLOAD_URL=https://github.com/griddb/griddb_nosql/releases/download/v${GRIDDB_VERSION}/griddb-nosql_${GRIDDB_VERSION}_amd64.deb
RUN apt-get -y update \
&& apt-get -y install curl python openjdk-9-jre vim
RUN curl ${DOWNLOAD_URL} --output griddb-nosql_amd64.deb --silent --location
RUN ls -lh ./
@alexanderzobnin
alexanderzobnin / zabbix_hosts_status_worldmap.sql
Last active October 24, 2018 13:31
SQL query for populating hosts status on WorldMap panel in Grafana
SELECT h.name as 'host', inv.location as 'geohash',
CASE
WHEN IFNULL(problems.count, 0)=0 AND IFNULL(status.value, 0)>0 THEN 0 -- Green status
WHEN IFNULL(problems.count, 0)>0 AND IFNULL(status.value, 0)>0 THEN 1 -- Yellow status
ELSE 2 -- Red status
END as 'metric'
FROM hosts h LEFT JOIN host_inventory inv USING(hostid)
LEFT JOIN (
SELECT h.hostid, COUNT(t.triggerid) as count
FROM triggers t, functions f, items i, hosts h
@alexanderzobnin
alexanderzobnin / pwned-pass-fast.py
Last active January 1, 2022 19:47
Script for searching passwords in Pwned Passwords database from haveibeenpwned.com
#!/usr/bin/python
import os
import hashlib
mypasswords = [
"doors",
"d00rs",
"Morrison",
"Hotel"
FROM debian:stable
# Copy the current directory contents into the container at /zas
# Current dir contains only github repo with zas_agent
ADD . /zas
WORKDIR /zas
RUN apt-get update && apt-get install -y ca-certificates python python-setuptools python-numpy
WORKDIR /zas/zas_agent/install
RUN python check_python_packages.py
@alexanderzobnin
alexanderzobnin / zabbix_api_auth.js
Created April 24, 2017 16:35
Zabbix API JS login
request(method, params) {
return this.zabbixAPICore.request(this.url, method, params, this.requestOptions, this.auth)
.catch(error => {
if (isNotAuthorized(error.data)) {
// Handle auth errors
this.loginErrorCount++;
if (this.loginErrorCount > this.maxLoginAttempts) {
this.loginErrorCount = 0;
return null;
} else {