Skip to content

Instantly share code, notes, and snippets.

View tonky's full-sized avatar

Igor Tonky tonky

  • Hellofresh SE
  • Berlin, Germany
View GitHub Profile
@tonky
tonky / main.rs
Last active December 7, 2023 22:56
Manager implementation
// link to playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=35796f2d8e1309189680a1d4df842224
// yeah, it occured to me that we can preallocate an array or vec and use '0' to mark minimum available position
// previous versions were implemented with min BinaryHeap, available in gist history
use std::{
cmp,
collections::{BinaryHeap, HashMap},
};
use regex::Regex;
@tonky
tonky / README.md
Created April 26, 2021 17:31 — forked from zhiguangwang/README.md
Building Unreal Engine Game Client and Dedicated Server on Linux.

Building Unreal Engine Game Client and Dedicated Server on Linux

Because the build tools of UE4 works across platforms (Windows, Mac OS, Linux), steps in this article can be applied to Mac OS and Windows as well.

On Windows, You need to replace RunUAT.sh with RunUAT.bat though.

Prerequisites

First, get Unreal Engine 4 sourcecode and export the following environment variables:

@tonky
tonky / Cargo.toml
Last active August 29, 2019 16:05
qemu error trying to run rust binary for nrf52-dk
[package]
name = "dev_nrf52"
version = "0.1.0"
authors = ["Igor Tonkopryadchenko <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
cortex-m = "0.6.0"
@tonky
tonky / gist:28656d080d6e62d7946de3ed34a6909e
Created October 22, 2018 17:48
cargo fmt 0.6.1 errors on stratisd
% cargo install --version 0.6.1 rustfmt --force
Updating crates.io index
Installing rustfmt v0.6.1
Downloaded cfg-if v0.1.6
Compiling winapi-build v0.1.1
Compiling winapi v0.2.8
Compiling libc v0.2.43
Compiling cfg-if v0.1.6
Compiling rustc-serialize v0.3.24
@tonky
tonky / stratis_1.0.0_error.txt
Last active October 8, 2018 06:35
error "rejected send message"
% journalctl -u stratisd
-- Logs begin at Sat 2018-10-06 15:31:03 EEST, end at Mon 2018-10-08 09:33:26 EEST. --
Oct 08 09:30:01 tonky-5520 systemd[1]: Started A daemon that manages a pool of block devices to create flexible file systems.
Oct 08 09:30:01 tonky-5520 stratisd[23805]: DEBUG libstratis::stratis::buff_log: BuffLogger: pass_through: true hold time: none
Oct 08 09:30:01 tonky-5520 stratisd[23805]: INFO stratisd: Using StratEngine
Oct 08 09:30:01 tonky-5520 stratisd[23805]: DEBUG stratisd: Engine state:
Oct 08 09:30:01 tonky-5520 stratisd[23805]: StratEngine {
Oct 08 09:30:01 tonky-5520 stratisd[23805]: pools: {},
Oct 08 09:30:01 tonky-5520 stratisd[23805]: incomplete_pools: {},
Oct 08 09:30:01 tonky-5520 stratisd[23805]: watched_dev_last_event_nrs: {}
@tonky
tonky / stratis-cli_error.txt
Created October 7, 2018 09:15
statis-clie rejected send message
[tonky@tonky-5520]~/projects/stratis-cli% ./bin/stratis daemon version
1.0.0
[tonky@tonky-5520]~/projects/stratis-cli% ./bin/stratis pool create mine /dev/loop0
Execution failure caused by:
Rejected send message, 2 matched rules; type="method_call", sender=":1.2834" (uid=1000 pid=31066 comm="python3 ./bin/stratis pool create mine /dev/loop0 " label="unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023") interface="org.storage.stratis1.Manager" member="CreatePool" error name="(unset)" requested_reply="0" destination=":1.2817" (uid=0 pid=30536 comm="./target/debug/stratisd --debug " label="unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023")
which in turn caused:
Error while invoking method "CreatePool" belonging to interface "org.storage.stratis1.Manager" with arguments (mine, dbus.Struct((dbus.Boolean(True), dbus.UInt16(0)), signature=dbus.Signature('bq')), dbus.Array([dbus.String('/dev/loop0')], signature=dbus.Signature('s')))
Most likely stratis has insufficient permissions for the a
@tonky
tonky / first.tla
Last active October 6, 2017 03:08
"Failure of assertion at line 13, column 4.")
---- MODULE first ----
EXTENDS Naturals, TLC
(* --algorithm first
variables alice_account = 10, bob_account = 10, money \in 1..20;
begin
Transfer:
if alice_account >= money then
A: alice_account := alice_account - money;
@tonky
tonky / gist:bede878db55913f7d2edb9368d3774bf
Last active April 19, 2017 18:43
clickhouse time series
create table if not exists points (date Date, time UInt64, tag String, values Array(Float64)) engine = Memory;
insert into points (date, time, tag, values) values (toDate(now()), 5, 'tag1', [5]);
insert into points (date, time, tag, values) values (toDate(now()), 17, 'tag1', [17]);
insert into points (date, time, tag, values) values (toDate(now()), 59, 'tag1', [59]);
insert into points (date, time, tag, values) values (toDate(now()), 55, 'tag1', [55]);
insert into points (date, time, tag, values) values (toDate(now()), 210, 'tag1', [210]);
// задача: дается start и end в наносекундах, нужно разбить их на n чанков и получить values
// для последнего значения time в каждом чанке, если он не пустой
@tonky
tonky / igor_tonkopryadchenko_cv_03_2017
Last active March 7, 2017 11:21
Igor Tonkopryadchenko CV 03.2017
Igor Tonkopryadchenko
Dnipro, Ukraine
born 1981
email: [email protected]
skype: iamtonky
phone: +380-68-560-12-67
languages: english - advanced, russian and ukrainian - fluent
result := make(chan string)
for _, url := range req.Site {
go func() {
findInPage(ctx, Page{url}, req.SearchText, result)
}()
}
select {
case <-ctx.Done():