Skip to content

Instantly share code, notes, and snippets.

View Pymmdrza's full-sized avatar
M M D R Z A . C o M

MMDRZA Pymmdrza

M M D R Z A . C o M
View GitHub Profile
@Pymmdrza
Pymmdrza / ip_range_octet_generator.py
Created August 14, 2025 01:37
IPv4 Generated from range octet
import random
from typing import Sequence
# Default per-octet inclusive ranges for the generated IPv4 address
OCTET_RANGES: tuple[tuple[int, int], ...] = (
(31, 245),
(31, 245),
(33, 245),
(66, 245),
)
@Pymmdrza
Pymmdrza / PyQt6_Default_Icons.py
Created July 8, 2025 13:51
All default icon PyQt6 for use free
import sys
from PyQt6.QtWidgets import QApplication, QGridLayout, QPushButton, QStyle, QWidget
class Window(QWidget):
def __init__(self):
super().__init__()
icons = sorted(
@Pymmdrza
Pymmdrza / vscode_setting_update_v1.0.0.json
Created June 25, 2025 12:33
Visual Studio Code Setting Config for Python Javascript and PHP , ... (Private Design)
{
"workbench.colorCustomizations": {
"editor.background": "#22242d",
"editor.foreground": "#D4D4D4",
"editor.selectionBackground": "#3f5e86",
"editor.lineHighlightBackground": "#333a4578",
"editorCursor.foreground": "#5cb5ff",
"terminal.background": "#36373b",
"terminal.foreground": "#D4D4D4",
"terminal.selectionBackground": "#264F78",
@Pymmdrza
Pymmdrza / useragent-generator.py
Created June 21, 2025 12:09
Generate random user agent in python without any extra packages 📦
# credit by : Pymmdrza.github.io
import random
from datetime import date
OS_CHOICES = {
"Macintosh": ["68K", "PPC", "Intel Mac OS X"],
"Windows": [
"Win3.11",
"WinNT3.51",
"WinNT4.0",
@Pymmdrza
Pymmdrza / hugginface_Image_Analyzer_gradio.py
Created May 8, 2025 17:03
Huggingface Image Analyzer With Transformers and Gradio
import gradio as gr
from transformers import pipeline
pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
def predict(input_img):
predictions = pipeline(input_img)
return input_img, {p["label"]: p["score"] for p in predictions}
gradio_app = gr.Interface(
import requests
import xml.etree.ElementTree as ET
from colorthon import Colors as Fore
import sys
rd, gr, gy, bl, yl, cy, wh = Fore.RED, Fore.GREEN, Fore.GREY, Fore.BLUE, Fore.YELLOW, Fore.CYAN, Fore.WHITE
r = Fore.RESET
# Define Class
@Pymmdrza
Pymmdrza / Mmdrza_Bolinger_Meta_v0.1.0.pine
Last active May 4, 2025 18:03
Mmdrza Bolinger Meta (Pine Script) for tradingview Strategy Auto Class Entry
//@version=5
strategy(shorttitle="MMDRZA Bollinger Meta 0.1.0", title="Mmdrza - Bollinger Bands Strategy with New Algorithm for any chart", overlay=true, commission_type=strategy.commission.percent, commission_value=0.1, slippage=0, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Inputs
length = input.int(20, minval=1, title="Length")
maType = input.string("SMA", "Basis MA Type", options = ["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"])
src = input(close, title="Source")
mult = input.float(2.0, minval=0.001, maxval=50, title="StdDev")
offset = input.int(0, "Offset", minval = -500, maxval = 500)
#!/bin/bash
install_blockhub() {
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" >&2
exit 1
fi
# check if is Mac OS
if [ "$(uname)" = "Darwin" ]; then
echo "This script must be run on Linux" >&2
@Pymmdrza
Pymmdrza / Ollama_FineTuning_Generate.py
Created March 4, 2025 08:41
Python Script for Fine Tuning and Traning Ollama Models
import json
import requests
import sys
from pathlib import Path
def query_ollama(prompt, model='mistral', context=''):
url = 'http://localhost:11434/api/generate'
data = {"model": model, "stream": False, "prompt": context+prompt}
response = requests.post(url, json=data)
response.raise_for_status()