<commit_before>#!/bin/bash
# Author: <NAME>
# License: MIT License (refer to README.md for more details)
#

# DO NOT EDIT ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING.
YELLOW='\e[93m'
RED='\e[91m'
ENDCOLOR='\033[0m'
CYAN='\e[96m'
GREEN='\e[92m'
SCRIPTPATH=$(pwd)

SOFTNAME='Nginx'

function pause(){
   read -p "$*"
}

clear
echo
echo -e $RED
echo -e "_    _   _ _  _ ____ ____ ____ _  _ ____ ____"
echo -e "|     \_/  |_/  |___ | __ |___ |\ | |___ [__ "
echo -e "|___   |   | \_ |___ |__] |___ | \| |___ ___]"
echo -e $CYAN
echo -e " __     ______  ____    _____           _ _    _ _   "
echo -e " \ \   / /  _ \/ ___|  |_   _|__   ___ | | | _(_) |_ "
echo -e "  \ \ / /| |_) \___ \    | |/ _ \ / _ \| | |/ / | __|"
echo -e "   \ V / |  __/ ___) |   | | (_) | (_) | |   <| | |_ "
echo -e "    \_/  |_|   |____/    |_|\___/ \___/|_|_|\_\_|\__|"
echo
echo -e $GREEN'Lykegenes '$SOFTNAME' Installer Script'$ENDCOLOR

echo
read -p 'Type y/Y and press [ENTER] to continue with the installation or any other key to exit: '
RESP=${REPLY,,}

if [ "$RESP" != "y" ]
then
    echo -e $RED'So you chickened out. May be you will try again later.'$ENDCOLOR
    echo
    pause 'Press [Enter] key to continue...'
    cd $SCRIPTPATH
    sudo ./setup.sh
    exit 0
fi

echo

echo -e $YELLOW'--->Refreshing packages list...'$ENDCOLOR
sudo apt-get update

echo
sleep 1

echo -e $YELLOW"--->Adding "$SOFTNAME" repository..."$ENDCOLOR
GREPOUT=$(grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep nginx)
if [ "$GREPOUT" == "" ]; then
    sudo add-apt-repository -y ppa:nginx/development
else
    echo $SOFTNAME" PPA repository already exists..."
fi

echo
sleep 1

echo -e $YELLOW"--->Refreshing packages list again..."$ENDCOLOR
sudo apt-get update

echo
sleep 1

echo -e $YELLOW"--->Installing "$SOFTNAME"..."$ENDCOLOR
sudo apt-get -y install nginx

echo
sleep 1

echo -e $YELLOW"--->Creating SSL Certificates folder..."$ENDCOLOR
sudo mkdir /certs
sudo chown -R :www-data /certs
echo -e $CYAN'/certs/'$ENDCOLOR ' - Folder created; put your SSL Certs in there'

echo -e $YELLOW"--->Generating Diffie-Hellman keys; this will take some time..."$ENDCOLOR
sudo rm -r /certs/dhparams.pem
sudo openssl dhparam -out /certs/dhparams.pem 2048
sudo chown -R :www-data /certs

echo -e $YELLOW"--->Copying Configuration files..."$ENDCOLOR
sudo mkdir -p /etc/nginx/vps-toolkit
sudo cp -R -f $SCRIPTPATH/webservers/nginx-conf /etc/nginx/vps-toolkit

echo
sleep 1

echo
echo -e $GREEN'--->All done. '$ENDCOLOR
nginx -v
echo

pause 'Press [Enter] key to continue...'

cd $SCRIPTPATH
sudo ./setup.sh
exit 0<commit_msg>Fix bug with Nginx setup<commit_after>#!/bin/bash
# Author: <NAME>
# License: MIT License (refer to README.md for more details)
#

# DO NOT EDIT ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING.
YELLOW='\e[93m'
RED='\e[91m'
ENDCOLOR='\033[0m'
CYAN='\e[96m'
GREEN='\e[92m'
SCRIPTPATH=$(pwd)

SOFTNAME='Nginx'

function pause(){
   read -p "$*"
}

clear
echo
echo -e $RED
echo -e "_    _   _ _  _ ____ ____ ____ _  _ ____ ____"
echo -e "|     \_/  |_/  |___ | __ |___ |\ | |___ [__ "
echo -e "|___   |   | \_ |___ |__] |___ | \| |___ ___]"
echo -e $CYAN
echo -e " __     ______  ____    _____           _ _    _ _   "
echo -e " \ \   / /  _ \/ ___|  |_   _|__   ___ | | | _(_) |_ "
echo -e "  \ \ / /| |_) \___ \    | |/ _ \ / _ \| | |/ / | __|"
echo -e "   \ V / |  __/ ___) |   | | (_) | (_) | |   <| | |_ "
echo -e "    \_/  |_|   |____/    |_|\___/ \___/|_|_|\_\_|\__|"
echo
echo -e $GREEN'Lykegenes '$SOFTNAME' Installer Script'$ENDCOLOR

echo
read -p 'Type y/Y and press [ENTER] to continue with the installation or any other key to exit: '
RESP=${REPLY,,}

if [ "$RESP" != "y" ]
then
    echo -e $RED'So you chickened out. May be you will try again later.'$ENDCOLOR
    echo
    pause 'Press [Enter] key to continue...'
    cd $SCRIPTPATH
    sudo ./setup.sh
    exit 0
fi

echo

echo -e $YELLOW'--->Refreshing packages list...'$ENDCOLOR
sudo apt-get update

echo
sleep 1

echo -e $YELLOW"--->Adding "$SOFTNAME" repository..."$ENDCOLOR
GREPOUT=$(grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep nginx)
if [ "$GREPOUT" == "" ]; then
    sudo add-apt-repository -y ppa:nginx/development
else
    echo $SOFTNAME" PPA repository already exists..."
fi

echo
sleep 1

echo -e $YELLOW"--->Refreshing packages list again..."$ENDCOLOR
sudo apt-get update

echo
sleep 1

echo -e $YELLOW"--->Installing "$SOFTNAME"..."$ENDCOLOR
sudo apt-get -y install nginx

echo
sleep 1

echo -e $YELLOW"--->Creating SSL Certificates folder..."$ENDCOLOR
sudo mkdir /certs
sudo chown -R :www-data /certs
echo -e $CYAN'/certs/'$ENDCOLOR ' - Folder created; put your SSL Certs in there'

echo -e $YELLOW"--->Generating Diffie-Hellman keys; this will take some time..."$ENDCOLOR
sudo rm -r /certs/dhparams.pem
sudo openssl dhparam -out /certs/dhparams.pem 2048
sudo chown -R :www-data /certs

echo -e $YELLOW"--->Copying Configuration files..."$ENDCOLOR
sudo mkdir -p /etc/nginx/vps-toolkit
sudo cp -R -f $SCRIPTPATH/webservers/nginx-conf/. /etc/nginx/vps-toolkit

echo
sleep 1

echo
echo -e $GREEN'--->All done. '$ENDCOLOR
nginx -v
echo

pause 'Press [Enter] key to continue...'

cd $SCRIPTPATH
sudo ./setup.sh
exit 0
{'fraction_non_alphanumeric': 0.1688186548467913, 'fraction_numerical': 0.008864906533050684, 'mean_word_length': 2.673036093418259, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1183915', 'n_tokens_mistral': 2164, 'n_tokens_neox': 2028, 'n_words': 543}