Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# MySQL root password
ROOTPASS="password"
TIMEZONE="Europe/Moscow"
MYSQLPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
SFTPPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
##############
#!/bin/bash
dir=/var/www/site
user=userofsite
echo "Set permissions for $dir...";
echo "CHOWN files...";
chown -R $user:$user "$dir";
echo "CHMOD directories...";
find "$dir" -type d -exec chmod 0755 '{}' \;
#!/bin/bash
ROOTPASS="password"
echo "Enter username to delete:"
read USERNAME
mysql -uroot --password=$ROOTPASS -e "DROP USER $USERNAME@localhost"
mysql -uroot --password=$ROOTPASS -e "DROP DATABASE $USERNAME"
rm -f /etc/nginx/sites-enabled/$USERNAME.conf
@govza
govza / addsite.sh
Last active February 4, 2023 18:00
#!/bin/bash
# MySQL root password
KEYLOCATION="/modx/.ssh/key.pem"
REMOTEUSERSERVER="[email protected]"
ROOTPASS="password"
TIMEZONE="Europe/Moscow"
MYSQLPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
#!/bin/bash
echo "Enter username"
read USERNAME
##############
echo "Updating MODx"
cd /var/www/$USERNAME/www/