Skip to content

Instantly share code, notes, and snippets.

View hasanparasteh's full-sized avatar
:octocat:

Hasan Parasteh hasanparasteh

:octocat:
View GitHub Profile
@hasanparasteh
hasanparasteh / Find_Copy_Paste.py
Last active March 13, 2019 23:05
It's grabs file extentions you want to find and copy all founded data to a folder
import fnmatch
import os
# pip install --user psutil
import psutil
from shutil import copy
def get_all_hard_disk_partitions():
partitions_list = psutil.disk_partitions()
partitions = [dp.device for dp in partitions_list if dp.fstype == 'NTFS']
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main(int argc, char const *argv[])
{
//Enter your local codes here
//If you want just a local number then remove [] and {} and just enter your local code in ""
string local_code[] = {"0912", "0935", "0936", "0937", "0938", "0939"};
@hasanparasteh
hasanparasteh / random_email_genrator.py
Created March 13, 2019 23:15
it will genrate random data into sql database
"""
Usage: first u need to create a database in phpmyadmin and enter
ur username and password in Login Information section!
After u just need to run the following commands:
$ pip install mysql-connector
$ pip install names
All Done!
"""
import mysql.connector
import names
@hasanparasteh
hasanparasteh / encryptor&decryptor.py
Created June 4, 2019 13:28
key module is an encryption/decryption platform for your daily usage.
# -*- coding: utf-8 -*-
"""key module is an encryption/decryption platform for your daily usage.
This module helps people protect they personal files from hackers, unauthorized people and etc. We protect your files
by using AES 256 encryption methods which no one would break. This program won't cache your passwords or backup your files
after encryption so all the responsibility of losing any data or anythong like that is yours...
Example:
key = Key("passowrd")
key.run(['filepath', 'another filepath'])
@hasanparasteh
hasanparasteh / file_mover.py
Created June 29, 2019 18:06
This script moves all episodes of a season of serial to a specific directory.
from os import listdir, getcwd, chdir
from os.path import isfile, join
from shutil import move
def check_name(file_name, search_name):
if search_name in file_name:
return True
else:
return False
def check_season(file_name, season):
@hasanparasteh
hasanparasteh / TimeComplexities.py
Created October 25, 2019 21:20
it is all of big O's time complexities code in python
import random
import math
import time
from itertools import permutations
import numpy as np
def auto_arr_gen(length):
arr = []
for i in range(1, length):
"""
Works only on 1920x1080 screen and the telegram channle should pinned to top!
"""
import sys
import subprocess
import keyboard
import pyautogui
def telegram_openner(location):
@hasanparasteh
hasanparasteh / ns2cloudserversimulation.tcl
Created July 2, 2020 08:57
It will simulate a multi-layer network for cloud data centers using ns2
set ns [new Simulator]
set f [open out.tr w]
$ns trace-all $f
set nf [open out.nam w]
$ns namtrace-all $nf
$ns color 1 Red
$ns color 2 Blue
@hasanparasteh
hasanparasteh / buildAndPush.yml
Created May 9, 2021 06:56
Build project and moves it into server via SCP
name: CI
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
@hasanparasteh
hasanparasteh / cloudSettings
Last active March 1, 2022 18:14
MP4 compressor using ffmpeg. it just scale down the video....
{"lastUpload":"2022-03-01T18:01:59.668Z","extensionVersion":"v3.4.3"}