Mahathir Almashor

33 papers A* 1B 3C 2Misc 1Journal 18Unranked 8
YearRankTypeTitle / Venue / Authors
2025 conf
CNS
Jaxson Brown, Duc-Son Pham, Sieteng Soh, Foad Motalebi, Sivaraman Eswaran, Mahathir Almashor
2025 J jnl
CoRR
Jaxson Brown, Duc-Son Pham, Sieteng Soh, Foad Motalebi, Sivaraman Eswaran, Mahathir Almashor
2025 conf
PAKDD (Workshops)
Ashfaqur Rahman, Mashud Rana, Mahathir Almashor, John McCulloch
2024 conf
e-Energy
Mahathir Almashor, Yusuke Miyashita, Sam West, Thi Van Dai Dong
2024 C conf
IECON
Geordie Dalzell, Chen Liu, Saumil Shah, Elena Kranz, Xinghuo Yu, Mahathir Almashor
2024 C conf
IECON
Chen Liu, Geordie Dalzell, Elena Kranz, Xinghuo Yu, Adrian Kelly, Mahathir Almashor
2023 conf
AI (1)
Mashud Rana, Ashfaqur Rahman, Mahathir Almashor, John McCulloch, Subbu Sethuvenkatraman
2023 J jnl
IEEE Trans. Ind. Informatics
Aditya Pribadi Kalapaaking, Ibrahim Khalil, Mohammad Saidur Rahman, Mohammed Atiquzzaman, Xun Yi, Mahathir Almashor
2023 J jnl
CoRR
Aditya Pribadi Kalapaaking, Ibrahim Khalil, Mohammad Saidur Rahman, Mohammed Atiquzzaman, Xun Yi, Mahathir Almashor
2023 A* conf
NDSS
Shuo Wang, Mahathir Almashor, Alsharif Abuadbba, Ruoxi Sun, Minhui Xue, Calvin Wang, Raj Gaire, Surya Nepal, Seyit Camtepe
2023 J jnl
Sensors
Chandra Thapa, Jun Wen Tang, Alsharif Abuadbba, Yansong Gao, Seyit Camtepe, Surya Nepal, Mahathir Almashor, Yifeng Zheng
2023 conf
BuildSys
Mahathir Almashor, Akbar Fadiansyah, Chehara Pathmabandu, Matt Amos, M. A. P. Chamikara
2023 J jnl
CoRR
Aditya Pribadi Kalapaaking, Veronika Stephanie, Ibrahim Khalil, Mohammed Atiquzzaman, Xun Yi, Mahathir Almashor
2023 conf
AINTEC
Mahathir Almashor, M. Ejaz Ahmed, Benjamin Pick, Jason Xue, Sharif Abuadbba, Raj Gaire, Shuo Wang, Seyit Camtepe, Surya Nepal
2023 conf
BuildSys
Mahathir Almashor, Mashud Rana, John McCulloch, Ashfaqur Rahman, Subbu Sethuvenkatraman
2022 J jnl
CoRR
Arthur Wong, Alsharif Abuadbba, Mahathir Almashor, Salil S. Kanhere
2022 J jnl
Future Gener. Comput. Syst.
Neda Bugshan, Ibrahim Khalil, Nour Moustafa, Mahathir Almashor, Alsharif Abuadbba
2022 J jnl
CoRR
Reena Zelenkova, Jack Swallow, M. A. P. Chamikara, Dongxi Liu, Mohan Baruwal Chhetri, Seyit Camtepe, Marthie Grobler, Mahathir Almashor
2022 J jnl
IEEE Netw.
Aditya Pribadi Kalapaaking, Veronika Stephanie, Ibrahim Khalil, Mohammed Atiquzzaman, Xun Yi, Mahathir Almashor
2022 J jnl
CoRR
Alsharif Abuadbba, Shuo Wang, Mahathir Almashor, Muhammad Ejaz Ahmed, Raj Gaire, Seyit Camtepe, Surya Nepal
2022 J jnl
CoRR
Mahathir Almashor, M. Ejaz Ahmed, Benjamin Pick, Sharif Abuadbba, Jason Xue, Raj Gaire, Shuo Wang, Seyit Camtepe, Surya Nepal
2021 J jnl
CoRR
Mahathir Almashor, M. Ejaz Ahmed, Benjamin Pick, Sharif Abuadbba, Raj Gaire, Seyit Camtepe, Surya Nepal
2021 conf
SmartIoT
Naimah Yaakob, Mahathir Almashor, Ahmed Fathi Muhammed Ahmed
2020 J jnl
CoRR
Chandra Thapa, Jun Wen Tang, Sharif Abuadbba, Yansong Gao, Yifeng Zheng, Seyit Ahmet Çamtepe, Surya Nepal, Mahathir Almashor
2020 J jnl
IEEE Trans. Aerosp. Electron. Syst.
Chunwu Wang, Bijay Guragain, Ajay K. Verma, Lewis Archer, Shubha Majumder, Abdiaziz Mohamud, Emily Flaherty-Woods, Geoffrey Shapiro, Mahathir Almashor, Mike G. Lenné, Rama Myers, Jonny Kuo, Shiyan Yang, Nicholas Wilson, Kouhyar Tavakolian
2016 J jnl
Simul. Model. Pract. Theory
Anton Beloglazov, Mahathir Almashor, Ermyas Abebe, Jan Richter, Kent Charles Barton Steer
2015 J jnl
IEEE Trans. Parallel Distributed Syst.
Mahathir Almashor, Ibrahim Khalil, Zahir Tari, Albert Y. Zomaya, Sartaj Sahni
2013 J jnl
IEEE J. Sel. Areas Commun.
Mahathir Almashor, Ibrahim Khalil, Zahir Tari, Albert Y. Zomaya
2012 J jnl
Computing
Mahathir Almashor, Ibrahim Khalil
2011 B conf
NCA
Mahathir Almashor, Ibrahim Khalil
2010 B conf
NCA
Mahathir Almashor, Ibrahim Khalil, Geoff Leach
2010 B conf
ICPADS
Mahathir Almashor, Ibrahim Khalil
2010 Misc conf
HiPC
Mahathir Almashor, Ibrahim Khalil
redb/utils/wrapper_run_sort_files.py
← Index redb/utils/wrapper_run_sort_files.py python
import os
import subprocess
import multiprocessing
import logging
from concurrent.futures import ThreadPoolExecutor
import signal

# Variables (replace these with actual values)
src_root_folder_path = "/mnt/samples/consilience/malware/vx-bazaar-expanded/"
dst_root_folder_path = "/mnt/samples/consilience/malware/_sorted_samples/vx-bazaar/"
log_folder_path = "/mnt/samples/consilience/malware/ops-logs/"
folder_names = ["Bazaar.2022.01", "Bazaar.2022.02", "Bazaar.2022.03", "Bazaar.2022.04"]  # List of folder names
script_name = "sort_files_by_type.py"
dry_run = True  # Set to True for testing without execution


# Ensure the log folder exists
os.makedirs(log_folder_path, exist_ok=True)

# Configure logging
main_log_name = "20241229-main_script.log"
main_log_file = os.path.join(log_folder_path, main_log_name)
if not os.path.exists(main_log_file):
    open(main_log_file, 'a').close()  # Create the log file if it doesn't exist
# main_log_file = os.path.join(log_folder_path, main_log_name)
# try:
#     with open(main_log_file, 'a') as f:
#         print(f"Successfully created/opened log file at: {main_log_file}")
#     # Verify the file exists
#     if os.path.exists(main_log_file):
#         print(f"Confirmed log file exists at: {main_log_file}")
#         print(f"File size: {os.path.getsize(main_log_file)} bytes")
# except Exception as e:
#     print(f"Error with log file: {e}")

# Configure logging
logging.basicConfig(
    filename=main_log_file,
    level=logging.INFO,
    format="%(asctime)s - %(levelname)s - %(message)s",
    force=True,
    filemode='a'
)

logging.info("Logging initialization test message")

# Add logging handler to flush immediately
class FlushableFileHandler(logging.FileHandler):
    def emit(self, record):
        super().emit(record)
        self.flush()

for handler in logging.getLogger().handlers:
    if isinstance(handler, logging.FileHandler):
        handler.flush()

# Global flag for graceful termination
terminate_flag = False

def signal_handler(signum, frame):
    global terminate_flag
    terminate_flag = True
    logging.warning("Termination signal received. Attempting to shut down gracefully.")

# Register signal handler
signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGTERM, signal_handler)

# Define the worker function
def process_folder(folder):
    global terminate_flag
    if terminate_flag:
        logging.warning(f"Skipping folder {folder} due to termination signal.")
        return

    try:
        # Extract the word and date fields from the folder name
        word, year, month = folder.split('.')

        # Construct source, destination, and log paths
        src_folder = os.path.join(src_root_folder_path, folder)
        dst_folder = os.path.join(dst_root_folder_path, folder)
        log_file = os.path.join(
            log_folder_path, f"20241229-SORT_FILES-bazaar_{year}.{month}.output.log"
        )

        if not os.path.exists(log_file):
            open(log_file, 'a').close()  # Create the log file if it doesn't exist

        # Build the command
        command = ["python3", script_name, src_folder, dst_folder]

        if dry_run:
            logging.info(f"Dry run: Would execute: {command}, log: {log_file}")
            print(f"Dry run: Would execute: {command}, log: {log_file}")
        else:
            logging.info(f"Starting task for folder: {folder}")
            with open(log_file, "w") as log:
                subprocess.run(command, stdout=log, stderr=subprocess.STDOUT, check=True)
            logging.info(f"Task completed for folder: {folder}")

    except subprocess.CalledProcessError as e:
        logging.error(f"Subprocess failed for folder {folder} with return code {e.returncode}: {e}")
        print(f"Subprocess failed for folder {folder}: {e}")
    except Exception as e:
        logging.error(f"Error while processing folder {folder}: {e}")
        print(f"Error while processing folder {folder}: {e}")

# Determine the number of processors
num_processors = multiprocessing.cpu_count()

try:
    # Process folders using ThreadPoolExecutor
    with ThreadPoolExecutor(max_workers=num_processors-1) as executor:
        executor.map(process_folder, folder_names)

except Exception as e:
    logging.critical(f"Critical error in the main execution: {e}")
    print(f"Critical error: {e}")

logging.info("All tasks completed.")
print("All tasks completed.")