Skip to content

Instantly share code, notes, and snippets.

View ergolyam's full-sized avatar

ergolyam ergolyam

  • Russia
  • 22:49 (UTC +03:00)
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / chatgpt-to-md.js
Last active September 12, 2025 21:19
Save current ChatGPT dialog (user + assistant) as a .md file via the Tampermonkey menu.
// ==UserScript==
// @name ChatGPT → Markdown saver
// @namespace tgpt.chat.markdown.saver
// @version 1.3
// @description Save current ChatGPT dialog (user + assistant) as a .md file via the Tampermonkey menu.
// @match https://chatgpt.com/*
// @match https://chat.openai.com/*
// @match http*://*/* // lets you run this on mirrors/embeds too (menu-only, harmless)
// @match file:///* // saved HTML files
// @grant GM_registerMenuCommand
@ergolyam
ergolyam / touchscreen-pad.py
Last active October 3, 2025 13:35
script that turns a touchscreen into a touchpad
#!/usr/bin/env python3
import argparse
import time
import math
import logging
from dataclasses import dataclass
from typing import Optional, Dict, Tuple, List
from evdev import InputDevice, UInput, ecodes as E
@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}"