Skip to content

Instantly share code, notes, and snippets.

View ljamel's full-sized avatar
🎯
Focusing

ljamel ljamel

🎯
Focusing
View GitHub Profile
@ljamel
ljamel / wsa.sh
Last active June 3, 2023 18:50
simple web SIEM bash
#!/bin/bash
# Chemin du fichier de journalisation Apache
logfile="/var/log/apache2/access.log.1"
# Liste des pages sensibles pour détecter les attaques
sensitive_pages=("admin.php" "phpmyadmin" ".env")
#codes_errors=("404" "403" "500" "400")
# Analyse du fichier de journalisation
@ljamel
ljamel / lamp.sh
Last active May 24, 2023 18:24
Install and configure LAMP
#!/bin/bash
echo -e "\n\nUpdating Apt Packages and upgrading latest patches\n"
sudo apt-get update -y && sudo apt-get upgrade -y || dnf update -y && sudo yum upgrade -y
echo -e "\n\nInstalling Apache2 Web server\n"
sudo apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 -y || dnf install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 -y
echo -e "\n\nInstalling PHP & Requirements\n"
sudo apt-get install libapache2-mod-php7.0 php7.0 php7.0-common php7.0-curl php7.0-dev php7.0-gd php-pear php7.0-mcrypt php7.0-mysql -y || dnf install libapache2-mod-php7.0 php7.0 php7.0-common php7.0-curl php7.0-dev php7.0-gd php-pear php7.0-mcrypt php7.0-mysql -y
@ljamel
ljamel / .sh
Created November 24, 2022 22:34
Deploy multi users in linux serveur
#!/bin/bash
declare -a tableau=( "martin" "john" "connor" )
i=${!tableau[@]}
for i in $i
do
#sudo useradd ${tableau[$i]}
#sudo passwd -f -u ${tableau[$i]}
echo "bonjour ${tableau[$i]}"
mdp=$(openssl rand -base64 9)
echo -e "$mdp" | passwd ${tableau[$i]}