This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
import pandas as pd | |
# Clés d'API Twitter (pour l'API v2) | |
BEARER_TOKEN = 'votre_bearer_token' | |
# Authentification avec l'API v2 | |
client = tweepy.Client(bearer_token=BEARER_TOKEN) | |
# Fonction pour rechercher des tweets récents contenant des mots-clés spécifiques |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Demander à l'utilisateur de saisir les variables nécessaires | |
read -p "Entrez le nom de votre sous-domaine (par exemple, sub.localhost) : " SUBDOMAIN | |
read -p "Entrez le nom de votre domaine principal (par exemple, localhost) : " DOMAIN | |
# Définir les autres variables en fonction des entrées utilisateur | |
WEB_ROOT="/var/www/$SUBDOMAIN/public_html" | |
APACHE_CONF="/etc/apache2/sites-available/$SUBDOMAIN.conf" | |
HOSTS_FILE="/etc/hosts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#creation de sous domaine | |
SUBDOMAIN="sub.example.org" | |
WEB_ROOT="/var/www/$SUBDOMAIN/" | |
APACHE_CONF="/etc/apache2/sites-available/$SUBDOMAIN.conf" | |
mkdir -p $WEB_ROOT | |
mkdir /var/www/$SUBDOMAIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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]} |