Skip to content

Instantly share code, notes, and snippets.

@chertov
chertov / build.sh
Last active October 11, 2023 15:39
Building pgmodeler on macos ARM
#!/bin/bash
set -e
script_path="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/"
echo script_path: ${script_path}
brew install openssl@1.1 libxml2 qt@6 postgresql@15 libpq
# export QT_ROOT=/opt/homebrew/Cellar/qt/6.5.2
export QT_ROOT=/Users/user/Qt/6.5.3/macos/
req: { "Name" : "General.General", "SessionID" : "0x00000070" }
res: { "General.General" : { "AutoLogout" : 0, "FontSize" : 24, "IranCalendarEnable" : 0, "LocalNo" : 0, "MachineName" : "LocalHost", "OverWrite" : "OverWrite", "ScreenAutoShutdown" : 10, "ScreenSaveTime" : 0, "VideoOutPut" : "Auto" }, "Name" : "General.General", "Ret" : 100, "SessionID" : "0x00000070" }
req: { "Name" : "General.Location", "SessionID" : "0x00000070" }
res: { "General.Location" : { "DSTEnd" : { "Day" : 1, "Hour" : 1, "Minute" : 1, "Month" : 10, "Week" : 0, "Year" : 2023 }, "DSTRule" : "Off", "DSTStart" : { "Day" : 1, "Hour" : 1, "Minute" : 1, "Month" : 5, "Week" : 0, "Year" : 2023 }, "DateFormat" : "YYMMDD", "DateSeparator" : "-", "IranCalendar" : 0, "Language" : "English", "TimeFormat" : "24", "VideoFormat" : "NTSC", "Week" : null, "WorkDay" : 62 }, "Name" : "General.Location", "Ret" : 100, "SessionID" : "0x00000070" }
req: { "Name" : "OPTimeQuery", "SessionID" : "0x00000070" }
res: { "OPTimeQuery" : "2023-08-01 00:19:07", "Re
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Starting periodic command scheduler: cron.
Starting enhanced syslogd: rsyslogdrsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
rsyslogd: activation of module imklog failed [v8.2102.0 try https://www.rsyslog.com/e/2145 ]
.
KiKiMR start failed
Traceback (most recent call last):
File "ydb/tests/library/harness/kikimr_runner.py", line 272, in start
self.__run()
File "ydb/tests/library/harness/kikimr_runner.py", line 292, in __run
@chertov
chertov / thread_pool.rs
Last active March 11, 2022 17:05
simple thread pool
use std::sync::Arc;
use parking_lot::RwLock;
use std::collections::VecDeque;
use log::trace;
use anyhow::anyhow;
struct Thread {
thread_handler: std::thread::JoinHandle<()>,
running: Arc<RwLock<bool>>,
# tarantool: '{ git = "https://github.com/chertov/tarantool-module.git", branch = "dev", features=["schema"] }'
# tarantool: '{ path = "/Users/user/dev/tarantool-module/tarantool", features=["schema"] }'
tarantool_schema: '{ git = "https://github.com/chertov/tarantool-schema.git" }'
# dependencies:
# bb_proto: '{ path = "./../../../bb_proto", features = ["tnt"] }'
spaces:
users:
engine: 'memtx'
// коллбеки на все найденые тесты в нашем проекте
type TestFunction = fn() -> Result<(), anyhow::Error>;
// глобальный лист всех найденных тестов, который сформируется при загрузке библиотеки в тарантул
static TESTS: once_cell::sync::Lazy<parking_lot::RwLock<std::collections::HashMap<String, TestFunction>>> =
once_cell::sync::Lazy::new(|| {
parking_lot::RwLock::new(std::collections::HashMap::new())
});
// для нашего теста fn test1 процедурный макрос атрибут tnt_test сегенерирует следующую функцию
@chertov
chertov / pubsub.rs
Last active November 17, 2021 19:51
rust schema codegen
use tarantool::index::{ IndexType, IndexOptions, IndexPart, IndexFieldType, IteratorType };
use tarantool::space::{ Space, SpaceCreateOptions, SpaceFieldFormat, SpaceFieldType };
use tarantool::tuple::{ AsTuple, Tuple };
pub const SPACE_NAME: &str = "pubsub";
const INDEX__ID: &str = "id";
const INDEX__TO: &str = "to";
const INDEX__CRATED_AT: &str = "crated_at";
#!/bin/bash
export GITHUB_TOKEN=<YOUR GITHUB TOKEN>
USER=<YOUR USERNAME>
WEBRTC_RS=webrtc-rs
# brew install gh
gh repo list ${WEBRTC_RS}
#pragma once
#include <vector>
#include <deque>
#include <map>
#include <string>
#include <google/protobuf/message.h>
#include <proto/common.pb.h>
#
# Automatically generated file; DO NOT EDIT.
# crosstool-NG Configuration
#
CT_CONFIGURE_has_static_link=y
CT_CONFIGURE_has_cxx11=y
CT_CONFIGURE_has_wget=y
CT_CONFIGURE_has_make_3_81_or_newer=y
CT_CONFIGURE_has_make_4_0_or_newer=y
CT_CONFIGURE_has_libtool_2_4_or_newer=y