Skip to content

Instantly share code, notes, and snippets.

View MohamedElashri's full-sized avatar

Mohamed Elashri MohamedElashri

View GitHub Profile
@MohamedElashri
MohamedElashri / cron_jobs_cheatsheet.md
Created March 21, 2025 13:09
Cron Jobs Cheat Sheet

Cron Jobs Cheat Sheet

1. Cron Time Format (Crontab Syntax)

Field Allowed Values Special Characters Meaning Example
Minute 0–59 * , - / Minute of the hour 0 = top of the hour
Hour 0–23 * , - / Hour of the day 5 = 5 AM
Day 1–31 * , - / Day of the month 15 = 15th
@MohamedElashri
MohamedElashri / ROOT_Cheatsheet.md
Created March 20, 2025 11:57
ROOT CheatSheet.

ROOT Cheat Sheet

1. Interactive work

Command Description
root -h show help for root command
root [-l] open ROOT
root [-l] file.root open ROOT and load a file
.? show help in interactive ROOT
@MohamedElashri
MohamedElashri / README.md
Last active February 1, 2025 11:02
use inspirehep api to look into top cited papers in 2024 in hep-ph

INSPIRE HEP-PH Top Papers Analysis

This script fetches and analyzes the top cited High Energy Physics - Phenomenology (HEP-PH) papers from 2024 using the INSPIRE API. It focuses on papers with 10 or fewer authors and generates a detailed table of the most cited papers.

Requirements

  • Python 3.7+
  • Required packages:
    pip install requests pandas tabulate
@MohamedElashri
MohamedElashri / README.md
Last active December 4, 2024 23:11
ROOT CERN Conda Environment creation script

Setup ROOT Environment Script

This script automates the creation of a Conda environment for working with ROOT and Python, including optional configuration for additional packages, Conda channels, and Python versions. It also sets up environment variables for seamless integration with tools like VSCode and Jupyter Notebook.

Features

  • Automates Environment Creation: Creates a Conda environment with ROOT and Python.
  • Customizable Options: Allows specifying additional packages, Conda channels, and Python versions.
  • Jupyter Kernel Integration: Automatically registers the environment as a Jupyter kernel.
  • Environment Variable Management: Dynamically sets up and cleans up ROOT-specific environment variables.
@MohamedElashri
MohamedElashri / REAMD.md
Created November 17, 2024 08:44
Script to make creating swap easier and quicker

What is this?

This is a simple Bash script designed to help easily create and manage swap files on a Linux system. It also allows easily configure kernel parameters vm.swappiness and vm.vfs_cache_pressure.


How to Use

@MohamedElashri
MohamedElashri / README.md
Last active November 15, 2024 21:53
install open snitch on debiad based linux distributions.

OpenSnitch Manager Script

A bash script to manage OpenSnitch installation, uninstallation, and repair on Linux systems. This script provides automated installation of both the OpenSnitch service and UI components, with proper desktop integration and autostart configuration.

Supported Distributions

  • Debian-based systems (Debian, Ubuntu, Linux Mint, Pop!_OS)
  • RHEL-based systems (CentOS, Fedora)
  • Arch Linux
@MohamedElashri
MohamedElashri / linux_shell_commands.md
Created November 6, 2024 13:47
List of Linux commands in tables categorized by tool types

List of Linux commands in tables categorized by tool types. source

File and Directory Operations

Command Description
cp Copy files to another location
mv Move or rename files or directories
rm Remove files
@MohamedElashri
MohamedElashri / mac_shell_commands.md
Created November 6, 2024 13:43
List of macOS commands in tables categorized by tool types

List of macOS commands in tables categorized by tool types. source

File and Directory Operations

Command Description
cp Copy files to another location
mv Move or rename files or directories
rm Remove files
mkdir Create new folders
@MohamedElashri
MohamedElashri / cern_sync.sh
Created November 4, 2024 02:25
script to sync between two machines via resync over ssh connection
#!/bin/bash
# Define colors for logs
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No color
log_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
@MohamedElashri
MohamedElashri / jupyter_tmux.md
Created October 9, 2024 16:40
Running a Long-Running Jupyter Notebook Remotely using tmux

Running a Long-Running Jupyter Notebook Remotely using tmux

Step-by-Step Instructions:

  1. Start tmux Session
    • Connect to your remote server via SSH:
      ssh user@remote-server
  • Start a tmux session to keep your terminal session active even after disconnection: