Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯

Ilya Konyukhov RunsFor

🎯
View GitHub Profile
@RunsFor
RunsFor / Dockerfile
Created Jan 21, 2021
Example on how to build static kafka module for use with static tarantool build
View Dockerfile
FROM registry.gitlab.com/runfor/envs/centos:7-build as static-kafka
RUN set -x \
&& git clone --recurse-submodules https://github.com/tarantool/kafka /opt/kafka \
&& wget -P /etc/yum.repos.d/ https://copr.fedorainfracloud.org/coprs/bgstack15/stackrpms/repo/epel-7/bgstack15-stackrpms-epel-7.repo \
&& yum install -y tarantool tarantool-devel openssl110 zip
WORKDIR /opt/kafka
RUN tarantoolctl rocks STATIC_BUILD=ON make \
@RunsFor
RunsFor / buildx-logs.txt
Created Dec 1, 2020
buildx daemon gets stuck when running build inside docker-build-and-push github actions action on a self-hosted runner. Sending SIGQUIT brings the following output of job logs
View buildx-logs.txt
SIGQUIT: quit
2020-12-01T09:47:49.7959653Z PC=0x5584306ce761 m=0 sigcode=0
2020-12-01T09:47:49.7960063Z
2020-12-01T09:47:49.7960640Z goroutine 0 [idle]:
2020-12-01T09:47:49.8033241Z runtime.futex(0x5584337f5748, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7ffe496451f0
==> _diag/pages/c4cb1678-ecb3-4e21-bb85-058e90c59a98_0f1d67d0-60c4-549e-f697-f7ec7a95557a_1.log <==
l7.noarch 152/181
2020-12-01T09:06:36.8798438Z #6 161.8 Installing : urw-base35-z003-fonts-20170801-10.el7.noarch 153/181
2020-12-01T09:06:38.3815517Z #6 163.3 Installing : urw-base35-nimbus-sans-fonts-20170801-10.el7.noarch 154/181
2020-12-01T09:06:39.8826066Z #6 164.7 Installing : urw-base35-p052-fonts-20170801-10.el7.noarch 155/181
@RunsFor
RunsFor / list_gitlab_projects.py
Created May 6, 2020
Simple python script which recursively iterates over a nested tree of subgroups and count a number of projects with shared runners option enabled
View list_gitlab_projects.py
#!/usr/bin/env python3
import json
import gitlab
gl = gitlab.Gitlab('http://gitlab.com', private_token="<put your private token here>")
GROUP_ID = '1234567890'
total_projects_count = 0
@RunsFor
RunsFor / ansible_fileglob.txt
Last active Apr 14, 2020
fileglob lookup plugin does not search playbook dir
View ansible_fileglob.txt
19:16:12 level2 [master] tree
├── file.txt
├── files
│   └── file.txt
├── hosts.yml
├── main.yml
└── roles
└── lookup
└── tasks
└── main.yml
@RunsFor
RunsFor / smtp.lua
Last active Nov 20, 2019
This snippet tests how smtp client (curl internally) handles error messages from smtp server
View smtp.lua
#!/usr/bin/env tarantool
local socket = require('socket')
local log = require('log')
local vars = {}
local function smtp_server(s)
s:write('220 localhost ESMTP Tarantool\r\n')
local l
@RunsFor
RunsFor / Kafka-segfault.txt
Created Jun 4, 2019
tarantool segfault when creating kafka consumer
View Kafka-segfault.txt
Tarantool 2.1.1-434-g881c7b59b
type 'help' for interactive help
tarantool> kafka = require'kafka'
---
...
tarantool> consumer, err = kafka.Consumer.create({
> brokers = 'localhost:9292', -- brokers for bootstrap
> options = {
> ["enable.auto.offset.store"] = "true",
@RunsFor
RunsFor / tarantool_socket_receive.txt
Created Apr 9, 2019
This gist shows inconsistent behaviour of tarantool's socket:receive function which internally uses different buffers for different types of calls
View tarantool_socket_receive.txt
Tarantool 2.1.1-434-g881c7b59b
type 'help' for interactive help
tarantool> socket = require('socket')
---
...
tarantool> fiber = require'fiber'
---
...
@RunsFor
RunsFor / main.lua
Last active Mar 27, 2019
Count nil values in the index
View main.lua
box.cfg{}
statuses = { 'sent', 'delivered' }
uuid = require('uuid')
clock = require('clock')
box.schema.create_space('fragments')
box.space.fragments:create_index('pk')
box.space.fragments:create_index('status', { unique = false, parts = {{3, 'string', is_nullable = true}}})
for i =1,500000,1 do box.space.fragments:insert({i,uuid.str(), statuses[math.random(0,2)]}) end
@RunsFor
RunsFor / nginx.conf
Last active Aug 1, 2022
HTTP terminating tools comparison in tarantool (MacBook Pro 13 2017 3.5 Ghz Intel Core i7, 16GB)
View nginx.conf
worker_processes 8;
error_log logs/error.log info;
events {
worker_connections 4096;
}
http {
include mime.types;
default_type application/octet-stream;
access_log off;
sendfile on;
@RunsFor
RunsFor / git-clone-graphql.txt
Created Feb 22, 2019
git show failed on a healthy commit
View git-clone-graphql.txt
$ git clone git@github.com:tarantool/graphql.git
Cloning into 'graphql'...
remote: Enumerating objects: 125, done.
remote: Counting objects: 100% (125/125), done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 2642 (delta 97), reused 99 (delta 89), pack-reused 2517
Receiving objects: 100% (2642/2642), 1.30 MiB | 407.00 KiB/s, done.
Resolving deltas: 100% (1996/1996), done.
$ cd graphql
$ git show e4f77a257e0e77a65992b21c9547529e6b80f78d