Skip to content

Instantly share code, notes, and snippets.

@Totktonada
Totktonada / cluster-config-json-schema.lua
Created March 8, 2024 21:04
Generate JSON schema for Tarantool's cluster configuration
#!/usr/bin/env tarantool
local json = require('json')
local cluster_config = require('internal.config.cluster_config')
local scalars = {}
scalars.string = {
jsonschema = {
type = 'string',
@Totktonada
Totktonada / protobuf_api_proposal.lua
Last active January 9, 2024 16:30
ProtocolBuffers encoder/decoder Lua module API proposal
local protobuf = require('protobuf')
-- The schema examples are from etcd.
--
-- https://github.com/etcd-io/etcd/blob/v3.5.11/api/mvccpb/kv.proto
-- https://github.com/etcd-io/etcd/blob/v3.5.11/api/etcdserverpb/rpc.proto
-- Message fields
-- --------------
@Totktonada
Totktonada / third-party-status.lua
Created October 17, 2023 11:48
third-party-status
#!/usr/bin/env tarantool
local fun = require('fun')
local json = require('json')
local yaml = require('yaml')
local fio = require('fio')
local http_client = require('http.client').new()
local popen = require('popen')
local this_file = fio.abspath(debug.getinfo(1).source:match("@?(.*)"))
@Totktonada
Totktonada / config.yaml
Last active August 24, 2023 00:16
Tarantool 3.0.0-alpha2 (demo)
credentials:
users:
replicator:
password: 'topsecret'
roles: [replication]
storage:
password: 'secret'
roles: [super]
iproto:
@Totktonada
Totktonada / doc-requests.py
Created March 8, 2023 01:50
Collect documentation requests from commits
#!/usr/bin/env python
from __future__ import print_function
import sys
import re
import subprocess
import argparse
import csv
@Totktonada
Totktonada / README.md
Created March 8, 2023 00:59
Dump GitHub issues into a CSV file

Overview

The script dumps issue list from GitHub into a CSV file.

Requirements

  • Python 3 (Python 2 should also work, but not tested)
  • requests

How to use

@Totktonada
Totktonada / graph.html
Created February 1, 2023 23:59
tarantool built-in modules dependencies
<!--
Based on https://github.com/vasturiano/3d-force-graph/blob/master/example/text-nodes/index.html
The data is generated from tarantool sources using the following one-liner:
(printf '{'; find src/lua src/box/lua -name '*.lua' | while read f; do fgrep -H 'require(' "${f}" | grep -v '\.lua: *--\|/help_en_US.lua'; done | sed -e 's@src/\(box/\)\?lua/\([^.]\+\).lua:@\2 @' -e 's@^\([^ ]\+\) .*require(["'\'']\([^"'\'']\+\)["'\'']).*@+\1 \2@' | grep '^+' | sed 's@^+@@' | sed 's/^init /tarantool /' | sort -u >data.txt; printf '"nodes": ['; cat data.txt | tr ' ' '\n' | sort -u | awk '{ print ",{\"id\": \""$1"\"}"}'; printf '], "links": ['; cat data.txt | awk '{ print ",{\"source\": \""$1"\", \"target\": \""$2"\"}" }'; printf ']}') | sed -e 's@"nodes": \[,{@"nodes": [{@' -e 's@"links": \[,{@"links": [{@' | jq > dependencies.json; rm data.txt
-->
<html>
<head>
@Totktonada
Totktonada / README.md
Created February 10, 2021 05:26
tarantool/http v1 vs v2 benchmarking

How to run

Prepare tarantool and modules builds:

git clone https://github.com/tarantool/http.git http-v1
cd http-v1
git checkout da1407c8e82dbdfd44abab8b1bb9860c217e7e22
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j
cd -
@Totktonada
Totktonada / .gitignore
Last active May 6, 2020 11:06
box.execute() measurements
tarantool-[abc]
log.txt
*.snap
*.xlog
*.csv
@Totktonada
Totktonada / region_watermark.c
Created April 16, 2020 16:01
Verify out-of-bound accesses with region.c buffers
static const uint64_t watermark_before = 0x74f31d37285c4c37;
static const uint64_t watermark_after = 0xb10269a05bf10c29;
static void *
region_alloc_with_watermark(struct region *region, size_t size)
{
size_t real_size = size + 2 * sizeof(uint64_t);
void *real_buf = region_alloc(region, real_size);
if (real_buf == NULL)
return real_buf;