You are ChatGPT, a large language model trained by OpenAI, based on the GPT-4 architecture. Knowledge cutoff: 2023-10 Current date: 2024-07-29
Image input capabilities: Enabled Personality: v2
| """ | |
| SOCKS5 DNS Proxy | |
| ================ | |
| **GUI VERSION IS HERE: https://github.com/mthri/smart-dns** | |
| Description: | |
| This script runs a local DNS server that acts as a proxy, selectively | |
| routing DNS queries through any SOCKS5 proxy. It's a powerful tool for | |
| enhancing DNS privacy and bypassing internet censorship or sanctions. |
| """ | |
| Divar to Telegram Notifier Bot | |
| This script monitors a filtered Divar page and sends newly posted items to a specified Telegram channel every 60 seconds. | |
| Setup Instructions: | |
| 1. Create a Telegram bot using BotFather. | |
| 2. Add the bot to your Telegram group or channel. | |
| 3. Promote the bot as an admin in your channel so it can post messages. | |
| 4. Use @username_to_id_bot to get the numeric ID of your channel (e.g., -1001234567890). |
| from functools import wraps | |
| import logging | |
| import time | |
| import requests | |
| logger = logging.getLogger(__name__) | |
| TELEGRAM_NOTIFICATION_BOT = 'YOUR_TELEGRAM_NOTIFICATION_BOT' | |
| TELEGRAM_NOTIFICATION_CHANNEL_ID = 'YOUR_TELEGRAM_NOTIFICATION_CHANNEL_ID' |
| import os | |
| LOGGING = { | |
| 'version': 1, | |
| 'disable_existing_loggers': False, | |
| 'handlers': { | |
| 'console': { | |
| 'level': 'DEBUG', | |
| 'class': 'logging.StreamHandler', | |
| }, | |
| 'file': { |
| from scapy.all import sniff, IP, TCP, Raw | |
| def extract_http_url(packet): | |
| """Extracts and prints HTTP URL from the packet""" | |
| if packet.haslayer(Raw): | |
| try: | |
| http_payload = packet[Raw].load.decode('utf-8') | |
| if "Host:" in http_payload: | |
| headers = http_payload.split("\r\n") |
| import hashlib | |
| import hmac | |
| TELEGRAM_BOT_TOKEN = 'BOT_TOKEN | |
| def extract_telegram_web_app_data(telegram_init_data: str) -> dict: | |
| return dict(qc.split('=') for qc in telegram_init_data.split('&')) | |
| def verify_telegram_web_app_data(telegram_init_data: str) -> bool: |
sudo docker rmi
sudo docker rm
sudo docker ps -a
sudo docker exec -it CONTAINER_HASH /bin/sh
sudo docker logs CONTAINER_HASH
sudo docker run -d CONTAINER_NAME:VERSION
sudo docker build -t IMAGE_NAME:VERSION .
sudo docker compose up -d
sudo docker compose down| # search some word in all log file in current directory | |
| ls | cut -d " " -f2 | xargs grep "WORD" | |
| # see live last log in current directory | |
| ls -ltrh | rev | cut -d' ' -f 1 | rev | tail -n1 | xargs tail -f |