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 / 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
@gourytch
gourytch / gist:bf875e6cf7c968bdc912c13ab097f603
Created July 4, 2017 12:16 — forked from samhocevar/gist:00eec26d9e9988d080ac
Configure sshd on MSYS2 and run it as a Windows service
#!/bin/sh
#
# msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service
#
# Please report issues and/or improvements to Sam Hocevar <sam@hocevar.net>
#
# Prerequisites:
# — MSYS2 itself: http://sourceforge.net/projects/msys2/
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights
#
@gourytch
gourytch / HFCalc.js
Last active May 21, 2017 14:41
HashFlare calculator: nodejs version
/*
* поиск оптимальной стратегии реинвестирования
* исходя из параметров майнера и наивной модели
* с зафиксированной стоимостью фалюты
* с неизменным значением ежедневной прибыльности
* и неизменяющейся вычислительной мощностью Сети
*/
let verbose = false;
@gourytch
gourytch / coinbrawl.user.js
Last active September 12, 2018 00:02
simple automation for https://www.coinbrawl.com/
// ==UserScript==
// @name CoinBrawlAutomaton
// @description Вкачиваем натыренное золото по статам
// @author Gourytch
// @license WTFPL
// @version 1.1
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
// @include https://coinbrawl.com/*
// @include https://www.coinbrawl.com/*
// @grant GM_getValue