Skip to content

Instantly share code, notes, and snippets.

@sofa-dm
sofa-dm / forwarder.py
Created March 12, 2024 17:55 — forked from aliforever/forwarder.py
Forward messages from a name to saved messages without marking message as seen in Telegram
# After running the script in logging in to your account, send "forward_unseen:mister_x:10" to your saved messages,
# the bot will then forward 10 last messages of the first user with name mister_x to your saved messages.
# This way you can check what people have sent you without them knowing you did.
from telethon import TelegramClient, events, sync
from telethon.tl.types import PeerUser
api_id = # Your Telegram API id here
api_hash = # Your Telegram API hash here
@sofa-dm
sofa-dm / read-access.sql
Created February 21, 2021 00:12 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;