Skip to content

Instantly share code, notes, and snippets.

View AminEgn's full-sized avatar
☁️

Amin Eidgahian AminEgn

☁️
View GitHub Profile
@AminEgn
AminEgn / check_open_ips.py
Created February 24, 2026 08:29
check open ips
import os
import socket
import ipaddress
import concurrent.futures
import sys
from typing import List
# Function to generate IPs from a CIDR notation (e.g., '192.168.1.0/24')
def generate_ips_from_cidr(cidr: str) -> List[str]:
try:
@AminEgn
AminEgn / web_socket.html
Last active February 24, 2026 08:30
web_socket
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Domain Updates</title>
<style>
#updates {
margin: 20px;
padding: 10px;
@AminEgn
AminEgn / reader_writer.py
Created January 28, 2023 06:47
reader and writer with lock state
# standard
import threading
import random
import time
class Worker(object):
"""Worker"""
def __init__(self, counter):
self.counter = counter
@AminEgn
AminEgn / barber.py
Created January 25, 2023 19:18
the barber mutex
# standard
import time
class BarberShop(object):
"""Barber Shop"""
def __init__(self, seat):
self.seat = seat
self.accessible_seats = 1
self.barber_ready = True
@AminEgn
AminEgn / producer_consumer_problem.py
Last active January 28, 2023 07:34
producer_consumer_problem
# standard
import threading
import random
import time
class Worker(object):
"""Worker"""
def __init__(self, counter):
@AminEgn
AminEgn / price_updater.py
Last active May 13, 2023 12:15
web scraping with bs4 and request for currency prices
# external
import requests
from bs4 import BeautifulSoup
SITE_URL = 'https://irarz.com/'
# file path
FILE_PATH = r'./env.txt'