This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import logging | |
class RequestLoggerHandler(BaseHTTPRequestHandler): | |
def do_GET(self): | |
# Log request details | |
self.custom_log_request() | |
# Send a response | |
self.send_response(200) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def scrape_proxy_from_geonode(page): | |
url = f"https://proxylist.geonode.com/api/proxy-list?limit=100&page={page}&sort_by=lastChecked&sort_type=desc" | |
payload = {} | |
headers = { | |
"accept": "application/json, text/plain, */*", | |
"accept-language": "en-US,en;q=0.9", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import json | |
def termux_battery_status(): | |
# Call the termux-battery-status command | |
result = subprocess.run(['termux-battery-status'], stdout=subprocess.PIPE) | |
battery_info = json.loads(result.stdout.decode('utf-8')) | |
return battery_info | |
def termux_get_location(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
def generate_md5_checksum(score, time, url, state, uuid): | |
print(checksum_string := f"{score}:{time}:{url}:{state}:{uuid}:crmjbjm3lczhlgnek9uaxz2l9svlfjw14npauhen") | |
md5_checksum = hashlib.md5(checksum_string.encode()).hexdigest() | |
return md5_checksum | |
score = 200 | |
time = 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
api_endpoint = "https://api.pawan.krd/v1/chat/completions" | |
api_key = "pk-PqVKRIqQYqRDcsFfhTTqYAqTJjaMaykeyNxbXvdiQEaMwjnE" | |
params = { | |
"model": "gpt-3.5-turbo", | |
"max_tokens": 300, | |
"messages": [ | |
{"role": "user", "content": "Explain quantum computing in cat language using meows"} |