Skip to content

Instantly share code, notes, and snippets.

View LocalT0aster's full-sized avatar
🌐

LocalT0aster Dan LocalT0aster

🌐
View GitHub Profile
@LocalT0aster
LocalT0aster / tg_notify.py
Last active September 2, 2025 10:09
Simple Telegram notification for bash scripts
#!/usr/bin/env python3
"""
Send a single Telegram message via Bot API.
Made by: ChatGPT 5 Thinking
Notes
-----
- Requires the target user to have started a chat with the bot.
- Uses only Python's standard library (urllib) for zero dependencies.

Quick OpenVPN setup guide

Step 1: get a Debian server

Debian will eat less RAM and have all the features that we need.

Step 2: apt config

nano /etc/apt/sources.list.d/*
@LocalT0aster
LocalT0aster / ExtractAttachments.py
Last active November 24, 2024 21:37
Extract PDF file attachmnets
import os;
import sys;
from pypdf import PdfReader;
os.makedirs("attachments", exist_ok=True);
print([open(f"attachments/{name}", "wb").write(content)
for name, content_list in PdfReader(sys.argv[1]).attachments.items()
for content in content_list])
@LocalT0aster
LocalT0aster / vscode-rpm.sh
Last active May 7, 2024 09:28
Install VSCode RPM
#!/usr/bin/env /bin/bash
echo "Installing VSCode rpm"
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit 1
fi
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/vscode.repo > /dev/null
dnf check-update
sudo dnf -y install code
@LocalT0aster
LocalT0aster / LocaleBase.py
Created January 15, 2024 17:59
pyTelegramBotAPI Locale module snippet
class Locale:
greet: list[str] = ['']
success: str = ''