Skip to content

Instantly share code, notes, and snippets.

View cofob's full-sized avatar
🏳️‍🌈

Egor Ternovoi cofob

🏳️‍🌈
View GitHub Profile
@cofob
cofob / 0_README.md
Last active May 15, 2025 15:57
Voice to text bot hosted on Cloudflare Workers and using DataCrunch API for Whisper X @yobaniy_ty_v_rot_bot

Telegram Voice Transcription Bot

A Cloudflare Workers-based Telegram bot that automatically transcribes voice messages and video notes using WhisperX AI.

Features

  • Transcribes voice messages and audio notes to text
  • Supports speaker diarization for video notes (identifies different speakers)
  • Secure authentication system with admin permissions
  • Selective chat approval (only works in chats approved by admins)
@cofob
cofob / telegram_html_export_parser.py
Created May 6, 2025 23:49
A Python script that converts Telegram HTML chat exports into a structured SQLite database.
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "beautifulsoup4>=4.13.4",
# "lxml>=5.4.0",
# "python-dateutil>=2.9.0.post0",
# ]
# ///
import os
# tidalapi==0.8.3
import tidalapi, json
# 1. Авторизация
session = tidalapi.Session()
# Выполняем вход
session.login_oauth_simple()
print(session.check_login())

NixOS Binary Cache Proxy

nixos-cache-proxy.cofob.dev is a simple reverse proxy to cache.nixos.org, running over the Cloudflare network and utilizing its cache.

It is intended for use if you:

  1. Do not have access to cache.nixos.org (e.g., your government has blocked it).
  2. You experience low speed on cache.nixos.org.

How to Use It

@cofob
cofob / install.sh
Created July 11, 2024 13:01
Easy install ffsend script
#!/usr/bin/env bash
# Version
VERSION="v0.2.76"
# URL to download
URL="https://github.com/timvisee/ffsend/releases/download/${VERSION}/ffsend-${VERSION}-linux-x64-static"
# Destination path
DEST="/usr/local/bin/ffsend"
@cofob
cofob / migrate.py
Last active March 29, 2024 15:54 — forked from chirauki/migrate.py
KVM migration script
#! /usr/bin/env nix-shell
#! nix-shell -i python3 -p python3Packages.libvirt python3Packages.paramiko python3Packages.urllib3
import logging
import argparse
import libvirt
import sys
import os
import subprocess
import paramiko
import xml.etree.ElementTree as ET
@cofob
cofob / arduino.ino
Last active March 29, 2024 09:27
Accelerometer + button
#include <Wire.h> // Wire library - used for I2C communication
int ADXL345 = 0x53; // The ADXL345 sensor I2C address
float X_out, Y_out, Z_out; // Outputs
const int BUTTON_READ_PIN = 5;
const int BUTTON_POWER_PIN = 6;
void setup() {
@cofob
cofob / install_nixos.sh
Created March 18, 2024 14:30
Aeza install NixOS
#!/usr/bin/env bash
curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | NIX_CHANNEL=nixos-23.11 doNetConf=y bash -x

Автоматическая отправка результатов генерации Eris в телеграм чат

Копируем скрипт ниже, заменяем на второй строке PATH на путь до родительской папки, где лежит SD. TGTOKEN и TGCHATID на 6 строке меняем на токен бота и на ID чата, куда будут отправляться дампы.

После можно добавить скрипт в crontab через команду crontab -e и вставив туда * * * * * PATH/send_to_tg.sh. (Предварительно поставив флаг +x на файл, чтобы сделать его исполняемым)

@cofob
cofob / 1_log_handler.py
Last active December 3, 2023 04:31
Taskiq async log collection
"""Taskiq log handler."""
import asyncio
from logging import Handler, LogRecord
from sys import stderr
from traceback import print_exc
from typing import Callable
class TaskiqHandler(Handler):