Skip to content

Instantly share code, notes, and snippets.

View OlegKorn's full-sized avatar
💭
SEEK FOR A JUNIOR QA JOB

O OlegKorn

💭
SEEK FOR A JUNIOR QA JOB
View GitHub Profile
@OlegKorn
OlegKorn / telethon_log_channels_posts.py
Last active January 5, 2025 02:20
telethon - logging channel's posts
import os
import logging
from telethon import TelegramClient, events
from telethon import errors
from telethon.tl.custom import Button
from telethon.errors.rpcerrorlist import FloodWaitError
import asyncio
@OlegKorn
OlegKorn / webp_to_png.py
Last active December 13, 2024 05:09
python - convert webp to png
from PIL import Image
import os
import fnmatch
drives = ['G:\\']
THIS_SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)).replace('\\', '/')
@OlegKorn
OlegKorn / telethon_monitor_channels_by_key_words.py
Created December 8, 2024 07:19
telethon - мониторинг каналов тг по словам
# автор =- https://github.com/security-hab/telegram-keyword-monitor/blob/main/main.py
channels_to_monitor = ['elite_estate', 'tash_nedvij', 'myhouse773', 'realestatemurod1',
'realtor_yunusov', 'apartments_tashkent', 'TheBestHomeUz', 'reeltoruz'] # Список имен каналов
keywords = ['аренда', 'Аренда', 'АРЕНДА', 'коммерческое', 'нежилое'] # Список ключевых слов
group_id_for_notifications = -1002370398266 # ID вашей группы
# Асинхронная функция для мониторинга каналов
@client.on(events.NewMessage(chats=channels_to_monitor))
async def handler(event):
@OlegKorn
OlegKorn / timeit.py
Created December 4, 2024 12:12
python - measure execution time function
# author - https://github.com/s3rgeym
import time
import functools
import typing
def timeit(fn: typing.Callable) -> typing.Callable:
@functools.wraps(fn)
@OlegKorn
OlegKorn / python_re_email.py
Created November 25, 2024 05:23
re - finding email in python
email_re = r"^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"
email = re.search(email_re, str)
@OlegKorn
OlegKorn / clear_dublicates.py
Created November 23, 2024 11:12
clear dublicated items from a file
import logging
file_dirty = "G:/Desktop/Emails/Cyprus/ccs.org.cy.txt"
def clear():
FORMAT = '%(message)s'
logging.basicConfig(
filename=f"G:/Desktop/Emails/Cyprus/{file_dirty.split('/')[-1]}_clear.txt",
level=logging.INFO,
@OlegKorn
OlegKorn / ebanaya pizda.py
Created February 12, 2024 07:01
this shit is for pizda and huj
.encode('cp1251').decode('utf-8')
#!/usr/bin/env python
"""Find domains on ip address using a ssl certificate"""
import argparse
import ipaddress
import logging
import os
import socket
import ssl
import sys
import tempfile
@OlegKorn
OlegKorn / working.py
Created February 6, 2024 00:02
last working version
import httpx
import asyncio
import aiohttp
import os
from fp.fp import FreeProxy
from time import sleep
import logging
@OlegKorn
OlegKorn / aiohttp requests ver2.py
Created February 5, 2024 06:57
aiohttp requests ver.2
import httpx
import asyncio
import aiohttp
import os
from fp.fp import FreeProxy
THIS_DIR = os.path.dirname(os.path.realpath(__file__)).replace('\\', '/')