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 / readme.md
Last active October 19, 2024 14:37
Run Tor Using Bundle Package From Torproject

Run Tor Using Bundle Package From Torproject

In this short manual I'll explain how to use latest tor executable along with the clients for snowflake, webtunnel and conjure.

  1. Downloading the Latest Bundle Package:
    Visit Tor Project Download Page or directly use the command:
    wget https://archive.torproject.org/tor-package-archive/torbrowser/13.5.7/tor-expert-bundle-linux-x86_64-13.5.7.tar.gz
  2. Extract the File:
@mh-firouzjah
mh-firouzjah / LinkedInConnectionBulkRemove.md
Last active April 9, 2024 13:04
a js code to bulk remove linkedin connections

LinkedIn Connections Bulk Remove

If you have problem with remove multiple LinekedIn connections at once, this code may help you.
In this code there is a filter that checks conection's occupation and based on that it will remove some connections.
Use some keyword to filter your connections and remove some.

Useage

In order to use this script open your connections page at linkedin.com quick open, then go to page inspect view and in the console paste the code below press Enter and wait till finishes it's job.

A Python Script To Fetch Data From RSS Feeds Asynchronously

async def task(work_queue: asyncio.Queue, client: httpx.AsyncClient, result: list[tuple[Post, Tag]]) -> None:
    while not work_queue.empty():
        source: Source = await work_queue.get()
        url = source.feed_url
        logger.info(f"Working on {url}")
        try:
            res = await client.get(url)
@mh-firouzjah
mh-firouzjah / Translator.md
Last active May 9, 2024 15:42
Translate selected text on Linux with ease! Assign a keyboard shortcut to instantly translate and pronounce selected texts. 🌐📝

Text Translator and Pronunciation Tool

This script provides a convenient way to check spelling, pronunciation, and translation of words or text using a dictionary (such as Google Translate) directly from your Linux desktop. It can be easily integrated with a keyboard shortcut, making it globally accessible for quick translation and pronunciation of selected text.

Background

As a non-native English speaker, I often find myself needing to verify the spelling, pronunciation, or translation of words, phrases, or paragraphs using an online dictionary like Google Translate. To streamline this process, I developed a script that allows me to quickly translate and hear the pronunciation of selected text with a simple keyboard shortcut.

How It Works

@mh-firouzjah
mh-firouzjah / zero-padding.md
Created May 31, 2023 15:14
Zero-Pad this is a zsh script in order to zero-pad mp4 & srt files so media players will always play them in natural integer format.

Zero-Pad

When I use linux OS, SMplayer is my favorite vidoe player but this media player has very anoying bug in it, beside all the havy customaization available via a very nice and simple GUI,it has.

The bug is this media player will sort any files that their names astriting with digits in alphabetical order regardless of natural integer numbers order, so for example after 1. file-name.mp4 it will jump to 11. file-name.mp4 instead of 2. file-name.mp4.

  • this bug is reporeted so many times but it's still there and no fix have been issued yet.
@mh-firouzjah
mh-firouzjah / box_drawing_chars.md
Last active August 2, 2021 09:48
box-drawing characters and their representations in Unicode Strings

Unicode characters

Braille

2880  0  1 2 3 4 5  6 7 8 9  a b c d e f

2880⠀⠀               

2810                
@mh-firouzjah
mh-firouzjah / better_powershell.md
Last active October 30, 2024 01:38
how to add zsh-like theme and feature to windows powershell

Better PowerShell

Theme | History | KeyBinding

MyPowershell

in order to make windows powershell more comfortable and add a some theme and features like history binding, auto complete on keypress and so on, if you have used linux teminl wiht zsh for example, we are going to make powershell like that as much as we can.

What we will achieve

@mh-firouzjah
mh-firouzjah / subtitle_encoder.md
Last active May 30, 2021 06:55
convert subtitle(.srt) files encoding form `windows 1256(arbic)` to `utf-8`.

Subtitle Decoder/Encoder

Subtitles are often not displayed properly on players due to incorrect encoding/decoding.

this python script is able to recive a path to subtitle/*.str files and change encoding form arabic/windows-1256 to utf-8.

'''
convert all subtile (*.srt) files inside given directory
from encoding `windows 1256` to `utf-8`
'''
@mh-firouzjah
mh-firouzjah / Django-login-required-middleware.md
Last active September 23, 2024 09:20
Django Login Required Middleware

Django Login Required Middleware

if you need users to be loged in first, before visiting your website, so it's easier to use a middleware to check if they're loged in or not. inorder to have such a middleware, use the following code:

# middleware.py
import re

from django.conf import settings
from django.contrib.auth.middleware import AuthenticationMiddleware