Skip to content

Instantly share code, notes, and snippets.

View mh-firouzjah's full-sized avatar
🐗
Valar Codilis: all men must code

Mahdi Firouzjah mh-firouzjah

🐗
Valar Codilis: all men must code
View GitHub Profile
@mh-firouzjah
mh-firouzjah / readme.md
Created October 30, 2024 14:34
Enhencing AriaNg A GUI For Aria2 DownloadManager

Enhencing AriaNg A GUI For Aria2 DownloadManager

  1. Install the aria2 package: Ensure that users have the necessary dependencies.
  2. Download the AriaNG All-in-One package: Extract it to a convenient location, such as ~/.local/opt/AriaNg.
  3. Create an executable script: This script would run aria2 before opening the HTML interface. I named it ariang-launcher.
  4. Create a desktop entry: This entry would allow users to add the application to their system's application menu for easy access.
  5. Ensure clean shutdown: Before closing the web page, User should ensure that aria2 shuts down properly to prevent it from running in the background. They could use the shutdown button in the Aria2 status page for this purpose.
  6. For the icon use https://github.com/mayswind/AriaNg/blob/master/src/favicon.png.

Sample Scripts

@mh-firouzjah
mh-firouzjah / rm.md
Created November 16, 2024 03:30
to share
@model_validator(mode="after")
def validate_other_information(self):
    parsed_info = {}
    errors = []
    remaining_text = self.other_information[:]

    for key, pattern in regex_patterns.OTHER_INFO_SWITCHES_MAPPING.items():
        bounded_pattern = re.compile(rf"\b{pattern[1:-1]}\b")  # Full validation regex
        switch_pattern = re.compile(rf"\b{key}/")  # Preliminary switch detection
@mh-firouzjah
mh-firouzjah / readme.md
Last active November 16, 2024 17:47
custom validate method for fastapi leveraging pydantic's validation error classes

the idea was to have a good and user friendly error response which is like the message at end of this file. it shows the error type, location, message and the input caused the error, for each validation error that any of those validation methods like validate_identification could raise.

# validators.py
from pydantic_core import InitErrorDetails, PydanticCustomError

from . import error_messages, regex_patterns
@mh-firouzjah
mh-firouzjah / kubuntu-post-installation.md
Last active September 30, 2025 11:57
General recommendations for post-installation

Kubuntu Post Installation Steps

This document is an annotated index of popular articles and important information for improving and adding functionalities to the installed Kubuntu system.

  1. configure ufw firewall
  2. remove snap and reboot
  3. update/upgrade
  4. install graphic driver
  5. disable crash-reporter that spams logs (apport.service)
  6. install proprietary media codecs