Skip to content

Instantly share code, notes, and snippets.

View ergolyam's full-sized avatar

ergolyam ergolyam

View GitHub Profile
@ergolyam
ergolyam / mikrotik_byedpi.md
Last active April 23, 2026 03:00
ByeDPI on MikroTik

ByeDPI на микротик

Подготовка

  1. Подключаем феш накопитель к mikrotik и форматируем его в ext4. Легче всего это сделать через winbox
  • Заходим в System > Disks > Format drive
  • Выбираем slot usb1 и file system ext4, и нажимаем start.
  • Ждём пока кнопка start снова не станет доступной.
  • Когда стала доступной то всё готово.
  1. Нужно установить пакет container.
@ergolyam
ergolyam / freedomain.rsc
Last active November 17, 2024 00:35
freedomain DynDNS for mikrotik
# MikroTik Script: freedomain.rsc
# Purpose: Update DNS records dynamically
:local apiKey "api_key"
:local domain "example.com,example.org"
:local fileName "last_pppoe_ip.txt"
:local lastIP
:local currentIP
@ergolyam
ergolyam / add-ppa.sh
Created November 24, 2024 21:12
Script that adds a ppa repository on any deb based distribution
#!/bin/bash
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
if [ $# -eq 1 ]; then
ppa_name=`echo "$1" | cut -d":" -f2 -s`
if [ -z "$ppa_name" ]; then
echo "PPA name not found"
echo "Utility to add PPA repositories in your debian machine"
echo "$0 ppa:user/ppa-name"
else
@ergolyam
ergolyam / WinPY.bat
Created December 9, 2024 16:14
Portable python for windows with WinPY
@echo off
setlocal enabledelayedexpansion
set "current_dir=%~dp0"
set "found_folder="
for /d %%d in ("%current_dir%WPy64*") do (
if exist "%%d" (
set "found_folder=%%d"
goto :folder_found
@ergolyam
ergolyam / 6in4.rsc
Created December 22, 2024 01:14
6in4 update Dyn IP with api for mikrotik
# MikroTik Script: 6in4.rsc
# Purpose: Update PPPoe IP dynamically
:local apiKey "api_key"
:local tunnelId "tunnel_id"
:local fileName "last_pppoe_ip2.txt"
:local lastIP
:local currentIP
@ergolyam
ergolyam / get_tg_session.py
Last active July 18, 2025 17:23
Script to get string telegram session
#!/usr/bin/env -S uv run --script
# /// script
# dependencies = [ "pyrofork", "tgcrypto-pyrofork" ]
# ///
import sys
from pathlib import Path
from pyrogram.client import Client
@ergolyam
ergolyam / pipefinder.sh
Last active January 15, 2026 23:41
Script for automated audio capture from Firefox to Telegram Desktop
#!/usr/bin/env bash
set -euo pipefail
SLEEP_SEC=2
OUTPUT_APP=""
INPUT_APP=""
declare -A LINKS_DONE=()
usage() {
cat <<EOF
@ergolyam
ergolyam / dump_tree_to_md.py
Last active July 18, 2025 17:54
Recursive saving of file contents from a directory in Markdown format
#!/usr/bin/env python3
import argparse
import fnmatch
from pathlib import Path
from typing import List, Optional, Union
try:
from pathspec import PathSpec
_HAS_PATHSPEC = True
@ergolyam
ergolyam / camera_ntfy.py
Created July 18, 2025 15:03
A script for automatically sending photos from a camera via FTP, created for cameras that send photos to an FTP server.
#!/usr/bin/env -S uv run --script
# /// script
# dependencies = ["httpx", "pyftpdlib"]
# ///
import os
import mimetypes
import tempfile
import logging
logging.basicConfig(
@ergolyam
ergolyam / update_spaceship.sh
Last active October 24, 2025 16:47
This custom updater integrates OpenWrt’s `ddns-scripts` with Spaceship.dev DNS.
#!/bin/sh
API_KEY="$api_key"
API_SECRET="$api_secret"
FQDN="$domain"
ADDR="$__IP"
TTL=3600
WAIT="${param_wait:-8}"
DNS="${dns_server:-1.1.1.1}"