Skip to content

Instantly share code, notes, and snippets.

View zhum's full-sized avatar

Zhumatiy Sergey zhum

View GitHub Profile
@zhum
zhum / zbx-exim-stats.sh
Last active November 28, 2020 13:03 — forked from crashdump/zbx-exim-stats.sh
A simple Zabbix statistics pusher for Zabbix-5. zbx-exim-stats.sh should be set to crontab, template should be imported.
#!/bin/bash
# Set Variables
EXIMLOG=/var/log/exim4/mainlog
MYLOG=/tmp/exim_status.log
OFFSETFILE=/tmp/eximstatusoffset.dat
EXIMSTATS="/usr/sbin/eximstats -emptyok"
LOGTAIL=/usr/sbin/logtail
ZABBIX_SENDER=/usr/bin/zabbix_sender
ZABBIX_CONF=/etc/zabbix/zabbix_agentd.conf
@zhum
zhum / gitproxy-socat
Created April 19, 2021 09:57 — forked from sit/gitproxy-socat
A simple wrapper around socat to use as a git proxy command
#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config --global core.gitproxy gitproxy
#
# More details at http://tinyurl.com/8xvpny
@zhum
zhum / bot.rb
Last active September 22, 2021 12:23 — forked from dideler/bot.rb
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@zhum
zhum / eink_demo.ino
Created October 24, 2021 06:24 — forked from xxlukas42/eink_demo.ino
MH-ET LIVE 1.54-inches E-Paper demo
#include <GxEPD.h>
#include <GxGDEP015OC1/GxGDEP015OC1.cpp>
#include <Fonts/OpenSansBold12pt7b.h>
#include <Fonts/OpenSansBold14pt7b.h>
#include <Fonts/OpenSansBold30pt7b.h>
#include <GxIO/GxIO_SPI/GxIO_SPI.cpp>
#include <GxIO/GxIO.cpp>
#include GxEPD_BitmapExamples
@zhum
zhum / memoization.rb
Created January 28, 2022 08:49 — forked from cqfd/memoization.rb
Ruby memoization exercise
require 'minitest/autorun'
module Memoization
def memoize(f, injected_cache={})
m = instance_method(f)
define_method(f) do |*args|
cache = injected_cache.clone
define_singleton_method(f) do |*args|
unless cache[args]
puts "Actually calculating..."