Skip to content

Instantly share code, notes, and snippets.

View arsalanyavari's full-sized avatar
🌐
کی میتونست؟ اونی که نمیدونست

Amir Arsalan Yavari arsalanyavari

🌐
کی میتونست؟ اونی که نمیدونست
View GitHub Profile
@arsalanyavari
arsalanyavari / docker-compose.yml
Created October 17, 2025 21:51
A script to setup Nexus with SSL
services:
nexus:
image: sonatype/nexus3
expose:
- 8081
- 8082
- 8083
- 8443
ports:
- "8081:8081"
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py .
EXPOSE 5000
CMD ["gunicorn", "-b", "0.0.0.0:5000", "app:app"]
@arsalanyavari
arsalanyavari / check_service.sh
Created June 20, 2025 00:31
This gist is only for educational content based on a course and has no other use.
#!/usr/bin/env bash
active_services_cnt=0
total_services_cnt=0
check_service_is_active() {
service_name=$1
systemctl is-active $service_name
}
@arsalanyavari
arsalanyavari / .env
Last active March 28, 2025 00:49
Bulk erase of all followers from Instagram
IG_USERNAME=
IG_PASSWORD=
IG_2FA=
@arsalanyavari
arsalanyavari / github_follow_back.sh
Created August 26, 2024 17:15
Run it using `bash github_follow_back.sh` command
#!/usr/bin/env bash
read -p "Enter your GitHub username: " USERNAME
echo "1. Followers who you don’t follow back"
echo "2. People you follow who don’t follow you back"
read -p "Enter your choice number (default 1): " CHOICE
CHOICE=${CHOICE:-1}
fetch_users() {
local USER_TYPE="$1"
@arsalanyavari
arsalanyavari / web_scraper.py
Last active August 15, 2024 08:53
A Python file to download images from Google search
import os
import requests
from bs4 import BeautifulSoup
from PIL import Image
from io import BytesIO
import time
import sys
MAX_ATTEMPTS = 5
EACH_PAGE_IMAGE_CNT=20
import pandas as pd
numberOfDuplications = 20
fileName = "file.csv"
df = pd.read_csv(fileName)
df = df.groupby("major_item").head(numberOfDuplications)
outputFileName = "cleaned_file.csv"
df.to_csv(outputFileName, index=False)
@arsalanyavari
arsalanyavari / README.md
Last active April 27, 2024 22:24
This is a Python script that uses OpenCV to invert the colors of an image, making black points white and white points black. Additionally, it combines every three consecutive images into a new image. I created this script for the blackboard images of Dr. Bayat's encryption engineering class at Sharif University of Technology.

How to run it:

  • First, store this Python code in any directory you prefer.
  • Next, create a Python virtual environment using the command python -m venv venv.
  • Then, activate the virtual environment with source ./venv/bin/activate and install the necessary dependencies using pip install numpy opencv-python opencv-python-headless.
  • Copy all image directories with appropriate names. For example:
.
|-- 04
|-- 05
|-- 06
@arsalanyavari
arsalanyavari / conio.h
Created December 2, 2022 09:05
conio.h file for linux
#ifndef CONIO_H
#define CONIO_H
#include <termios.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
services = {
'1': 'tcpmux',
'2': 'compressnet',
'3': 'compressnet',
'5': 'rje',
'7': 'echo',
'9': 'discard',
'11': 'systat',
'13': 'daytime',
'17': 'qotd',