Skip to content

Instantly share code, notes, and snippets.

View gourytch's full-sized avatar

Lev V. Babchenko gourytch

  • Teracloud ApS
  • Copenhagen, Denmark
View GitHub Profile
@gourytch
gourytch / GeoLite2-Country-to-ipset.py
Created August 12, 2025 10:57
Parse GeoLite2-Country.mmdb and create shell scripts with ipset rules
#! /usr/bin/python3
#
# this script reads the GeoLite2-Country base and
# for each country
# creates shell scripts with ipset rules
#
# before use this do:
# install pip install maxminddb
# read this: https://www.maxmind.com/en/geolite-free-ip-geolocation-data
# download GeoLite2-Country_YYYYmmdd.tar.gz from MaxMind
@gourytch
gourytch / LockWatcher.ps1
Created July 30, 2025 07:56
Set power saving scheme when workstation is locked
<#
# How to enable 4800..4803 events
* run `gpedit.msc`
* goto:
->`Computer Configuration`
->`Windows Settings`
->`Security Settings`
->`Advanced Audit Policy Configuration`
->`System Audit Policies - Local Group Policy Object`
->`Logon/Logoff`
@gourytch
gourytch / gogrepoc
Created September 24, 2024 21:45
py3-venv wrapper around the gogrepoc script
#! /bin/bash
# required to work:
# sudo apt-get install -y python3-venv
# typical test scenario:
# ./gogrepoc login # login to GoG and get the auth token
# ./gogrepoc update # fetch information and create the manifest
# ./gogrepoc download -dryrun # get installers
# ./gogrepoc verify # check all the installers for consistency
base=$(dirname $(readlink -f $0))
@gourytch
gourytch / kalaha.cxx
Created March 26, 2023 16:27
a quick-n-dirty implementation of game kalaha (mancala)
#include <cstdio>
#include <cstdint>
#include <cstdlib>
#include <ctime>
#include <array>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <cassert>
@gourytch
gourytch / Dockerfile
Last active January 22, 2021 23:13
build pgmodeller to the /opt/pgmodeler directory
ARG CODENAME=focal
ARG INSTALLATION_ROOT="/opt/pgmodeler"
FROM ubuntu:${CODENAME} as build
ARG CODENAME
ARG INSTALLATION_ROOT
ENV CODENAME="${CODENAME}"
ENV INSTALLATION_ROOT="/opt/pgmodeler"
#! /bin/sh
set -e
set -x
name='Bitradio'
branch='master'
with_incompatible_bdb=0
patch_atomic_pointer=0 #1
DEBIAN_FRONTEND=noninteractive apt-get install -y \
@gourytch
gourytch / start-tg-instance.sh
Created April 15, 2019 18:42
launch separate Telegram instance from /snap
#! /bin/sh
set -e
set -x
ulimit -v 4000000
ulimit -c 2000000
export BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/telegram-desktop_telegramdesktop.desktop
telegram="/snap/bin/telegram-desktop"
@gourytch
gourytch / sirus_create.cmd
Created January 16, 2019 16:55
Create WoW Linked Environment for new sirus account
@echo off
SET "name_uc=%1"
SET "name_lc=%1"
setlocal EnableDelayedExpansion
for %%b in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do set "name_uc=!name_uc:%%b=%%b!"
for %%b in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do set "name_lc=!name_lc:%%b=%%b!"
SET REF=c:\toys\wow-sirus
SET DST=c:\toys\sirus-%name_lc%
@gourytch
gourytch / wotlk_macros.txt
Last active April 1, 2019 21:22
My WotLK macroses
#
# Druid
####################################################################
# shift shape to bear and start attack
#showtooltip
/cast [nostance:1] !Облик медведя
/stopmacro [noexists][noharm][dead]
/cast Рык
@gourytch
gourytch / DOCKER_CLEANUP.sh
Created July 18, 2017 07:11
docker cleanup
#! /bin/bash
# remove all stopped containers
docker ps -a -q | xargs -r docker rm
#remove all unused volumes
docker volume ls -qf dangling=true | xargs -r docker volume rm
# remove all untagged images
docker images -q -f dangling=true | xargs -r docker rmi