Skip to content

Instantly share code, notes, and snippets.

View ernado's full-sized avatar

Aleksandr Razumov ernado

View GitHub Profile
@ernado
ernado / upload.go
Last active April 8, 2024 11:31
gotd upload example
package main
import (
"context"
"os"
"path/filepath"
"time"
"github.com/dustin/go-humanize"
"github.com/go-faster/errors"
@ernado
ernado / prima.py
Created July 2, 2013 12:59
Алгоритм Прима
__author__ = 'Разумов А.А.'
# Реализация алгоритма Прима на python 3
import random
from string import ascii_uppercase
def prima(W, city_labels = None):
"""
Алгоритм Прима для нахождения сети дорог минимальной длины
@ernado
ernado / command.txt
Created July 24, 2023 09:14
yt_local
Command: /src/faster/oteldb/internal/ytlocal/.venv/bin/yt_local start --proxy-port 8080 --master-config /tmp/ytlocal-python-3075677362/resolver.yson --node-config /tmp/ytlocal-python-3075677362/resolver.yson --scheduler-config /tmp/ytlocal-python-3075677362/resolver.yson --controller-agent-config /tmp/ytlocal-python-3075677362/resolver.yson --rpc-proxy-config /tmp/ytlocal-python-3075677362/resolver.yson --local-cypress-dir /tmp/ytlocal-python-3075677362/resolver.yson --fqdn localhost --ytserver-all-path /usr/local/bin/ytserver-all --sync
2023-07-24 12:12:27,758 INFO Start preparing cluster instance as follows:
2023-07-24 12:12:27,758 INFO masters 1 (0 nonvoting) (version: 23.2.0-local-os~16ff06a256729d98+distbuild)
2023-07-24 12:12:27,758 INFO nodes 1 (0 chaos) (version: 23.2.0-local-os~16ff06a256729d98+distbuild)
2023-07-24 12:12:27,758 INFO schedulers 1 (version: 23.2.0-local-os~16ff06a256729d98+distbuild)
2023-07-24 12:12:27,758 INFO controlle
@ernado
ernado / logs.jsonl
Created March 25, 2023 10:38
Logs for connection dead
{"level":"info","ts":1679740371.865786,"logger":"client.conn.mtproto.rpc","caller":"rpc/engine.go:42","msg":"Initialized","v":"v0.79.0","conn_id":0,"dc_id":2,"retry_interval":5,"max_retries":5}
{"level":"info","ts":1679740371.8658545,"logger":"client","caller":"telegram/connect.go:114","msg":"Starting","v":"v0.79.0"}
{"level":"debug","ts":1679740371.865991,"logger":"client.conn.mtproto","caller":"mtproto/conn.go:198","msg":"Run: start","v":"v0.79.0","conn_id":0,"dc_id":2}
{"level":"info","ts":1679740371.9107969,"logger":"client.conn.mtproto","caller":"mtproto/connect.go:32","msg":"Generating new auth key","v":"v0.79.0","conn_id":0,"dc_id":2}
{"level":"debug","ts":1679740371.9108443,"logger":"client.conn.mtproto","caller":"mtproto/connect.go:65","msg":"Initializing new key exchange","v":"v0.79.0","conn_id":0,"dc_id":2,"timeout":60,"context_deadline":1679740406.8660336}
{"level":"debug","ts":1679740371.9108987,"logger":"client.conn.mtproto.exchange","caller":"exchange/client_flow.go:26","msg":"Sending ReqPqMult
@ernado
ernado / vendor.sh
Last active February 21, 2023 15:09
vendor tetragon and release
#!/bin/bash
VERSION=$1
grep -rl cilium/tetragon --exclude-dir=vendor --exclude-dir=.git --exclude vendor.sh | xargs sed -i 's|cilium/tetragon|go-faster/tetragon|g'
sed -i 's|quay.io|ghcr.io|g' install/kubernetes/values.yaml
sed -i 's|-t "go-faster|-t "ghcr.io/go-faster|g' Makefile
sed -i 's|push go-faster|push ghcr.io/go-faster|g' Makefile
grep -rl v0.0.0-00010101000000-000000000000 --exclude-dir=vendor --exclude-dir=.git --exclude vendor.sh | xargs sed -i "s|v0.0.0-00010101000000-000000000000|$1|g"
sed -i "s|0.8.3|${VERSION:1}|g" install/kubernetes/Chart.yaml
sed -i "s|v0.8.3|$1|g" install/kubernetes/values.yaml
@ernado
ernado / main.py
Created June 29, 2011 11:24
Profiler for GeneticAlgorythm
# -*- coding: utf-8 -*-
import cProfile
from random import randint
from copy import deepcopy
from math import floor
import random
class Organism:
#initiate
def __init__(self, alleles, fitness, likelihood):
@ernado
ernado / otel.shecma.json
Created January 26, 2022 10:44
OTEL Log Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Entry",
"title": "OpenTelemetry Log Data Model",
"description": "https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md",
"definitions": {
"Map": {
"patternProperties": {
".*": {
"$schema": "http://json-schema.org/draft-04/schema#",
@ernado
ernado / golang.sh
Created May 10, 2016 10:58
/etc/profile.d/golang.sh
#!/bin/bash
# sets envs for golang
if [ -z "$GOPATH" ]; then
export GOROOT="/usr/local/go"
export GOPATH="/go"
export PATH="$PATH:$GOPATH/bin:$GOROOT/bin"
fi
@ernado
ernado / System Design.md
Last active April 15, 2021 10:17 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?