Skip to content

Instantly share code, notes, and snippets.

View ilyaevseev's full-sized avatar

Ilya Evseev ilyaevseev

  • Loyaltyplant.com
  • Nazareth, Israel
  • 19:32 (UTC +03:00)
  • LinkedIn in/ilyaevseev
View GitHub Profile
@ilyaevseev
ilyaevseev / ros-in-vm.md
Last active August 15, 2025 20:44
RouterOS in VirtualBox
@ilyaevseev
ilyaevseev / win-hwclock-utc.reg
Last active August 14, 2025 15:17
Fix hardware clock shift on dual boot between Windows and Linux
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=dword:00000001
@ilyaevseev
ilyaevseev / cassandra-watchdog
Created May 28, 2025 21:01
Cassandra NoSQL quick+dirty watchdog script
#!/bin/sh
test "$(systemctl is-active cassandra)" = "active" || exit 0
pid="$(systemctl show -p MainPID --value cassandra)"
test "$pid" = "" && exit 0
test "$pid" = "0" && exit 0
UPTIME="$(ps -o etimes:1 --no-headers -p $pid)"
@ilyaevseev
ilyaevseev / postgres-backup.sh
Created December 31, 2024 12:08
pg_basebackup cron.daily wrapper script.
#!/bin/sh -e
BASE="/mnt/backups/postgres"
DEST="$BASE/$(date +%Y-%m-%d-%H%M)"
AGE="2"
Echo() { date +"%Y-%m-%d %H:%M:%S -- $@"; }
Echo "Mkdir1..." ; mkdir -pm710 "$BASE" && chown root:postgres "$BASE"
Echo "Mkdir2..." ; mkdir -pm700 "$DEST" && chown postgres "$DEST"
@ilyaevseev
ilyaevseev / clickhouse-backup
Created May 8, 2024 03:54
Quick and dirty Clickhouse database daily backup script
#!/bin/sh -e
T="$(date +%Y-%m-%d-%H%M)"
BASEDIR=/opt/backups/clickhouse
DESTDIR="$BASEDIR/$T"
. ~/.env.clickhouse # ..CLICKHOUSE_HOST,USERNAME,PASSWORD,DATABASE
Query() {
@ilyaevseev
ilyaevseev / rocket1.bas
Created February 21, 2023 17:38
First sample for Sofa on QB64
Screen 12
Let StepX = 100
Let StepY = 100
Let ScreenWidth = _Width
Let ScreenHeight = _Height - 20
For X = 0 To ScreenWidth Step StepX
Line (X, 0)-(X, ScreenHeight), 7
Next
@ilyaevseev
ilyaevseev / check-nservers
Created December 3, 2022 21:00
Validate domain NS records against whois and NS servers.
#!/usr/bin/perl
use strict;
use warnings;
use Storable qw/freeze/;
$Storable::canonical = 1; # https://www.perlmonks.org/?node_id=127254
die "Usage: $0 domain-name\n" unless @ARGV == 1;
my $domain = shift @ARGV;
@ilyaevseev
ilyaevseev / Asterisk-WAV-Compress
Created October 19, 2022 14:51
Asterisk cron.weekly script for compressing old wav-files stored in /var/spool/asterisk/monitor
#!/bin/sh -e
WAV_AGE="185"
WAV_DIR="/var/spool/asterisk/monitor"
ARC_DIR="/home/asterisk-archives"
if test $# = 0; then
test "$(pgrep -fc "$0")" = "1" || { echo "${0##*/} is already running, exit."; exit 1; }
cd "$WAV_DIR"
nice ionice -c3 find . -type f -mtime +"$WAV_AGE" -name "*.wav" -exec "$0" '{}' +
@ilyaevseev
ilyaevseev / genbcrypt.py
Last active August 8, 2024 18:34
Generate bcrypt password for GLAuth
#!/usr/bin/python3
# apt install python3-bcrypt
import string
import random
import bcrypt
import sys
from getpass import getpass
@ilyaevseev
ilyaevseev / passwd-auth-script.sh
Created April 23, 2022 23:49
External password authorization script for OpenVPN server
#!/bin/sh
# Environment variables:
# username (required)
# password (optional for all except check)
# Usage in openvpn-server.conf:
# auth-user-pass-verify "/etc/openvpn/passwd-auth-script" via-env
# script-security 3
# verify-client-cert none