Skip to content

Instantly share code, notes, and snippets.

View pyGuru123's full-sized avatar
:electron:
Learning

Prajjwal Pathak pyGuru123

:electron:
Learning
View GitHub Profile
@pyGuru123
pyGuru123 / webserver.py
Created November 23, 2024 05:23
simple python webserver to log requests
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)
@pyGuru123
pyGuru123 / proxies_scraper.py
Created November 19, 2024 11:59
Free Proxies Scraper ( Geonode )
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",
@pyGuru123
pyGuru123 / termux-api-automate.py
Created October 7, 2024 15:56
Python code to interact with android using termux and termux-api package
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():
@pyGuru123
pyGuru123 / gamee.py
Last active September 23, 2024 02:58
checksum for gamee - telegram
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
@pyGuru123
pyGuru123 / chatgpt-rev-proxy1.py
Created May 26, 2023 18:51
Using unofficial api key for chatgpt using Reverse Proxy
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"}