diff --git a/dirsize/dirsize.sh b/dirsize/dirsize.sh index 579d00c..8472a2c 100644 --- a/dirsize/dirsize.sh +++ b/dirsize/dirsize.sh @@ -1,4 +1,27 @@ #!/bin/bash + +## MakeVHost Script +## Author: Ze'ev Schurmann +## Reddit: u/thisiszeev +## License: GPL-3.0 or later + +## Copy this file to /usr/bin as dirsize (not dirsize.sh) + +## From any folder that you want to assess the size of each folder within the current folder, +## simply type dirsize + +## Please consider making me small donation. Even though my scripts are open source and free to use, I still need to eat. And the +## occasional bottle of wine also goes down well. +## $5 buys me a cup of coffee +## $10 buys me a nice burger +## $20 buys me a bottle of wine +## Anything above that will be awesome as well. +## You can send me a donation via Paypal https://www.paypal.com/paypalme/thisiszeev +## Drop me a message on Reddit if you do make a donation. +## Support is only offered freely to those who donate $20 or more. +## Your donation contributes to further development. +## If you need a custom script, contact me on Reddit for pricing. + if [[ -f "/tmp/dir.list" ]]; then rm "/tmp/dir.list" fi @@ -20,4 +43,4 @@ while read -r foldername; do du -h $foldername | tail -1 fi done < "/tmp/dir.list" -rm "/tmp/dir.list +rm "/tmp/dir.list" diff --git a/makevhost/makevhost.sh b/makevhost/makevhost.sh new file mode 100644 index 0000000..22e9194 --- /dev/null +++ b/makevhost/makevhost.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +## MakeVHost Script +## Author: Ze'ev Schurmann +## Reddit: u/thisiszeev +## License: GPL-3.0 or later + +## This script creates a vhost on a debian based server running Apache2. It assumes that +## the www path is /var/www/ and that the Apache2 logs are stored at /var/log/apache2/ + +## To use it, either use ./makevhost.sh {domainname} or simple use ./makevhost.sh and it +## will ask you for the domain name. + +## Requires certbot from Let's Encrypt + +## Please consider making me small donation. Even though my scripts are open source and free to use, I still need to eat. And the +## occasional bottle of wine also goes down well. +## $5 buys me a cup of coffee +## $10 buys me a nice burger +## $20 buys me a bottle of wine +## Anything above that will be awesome as well. +## You can send me a donation via Paypal https://www.paypal.com/paypalme/thisiszeev +## Drop me a message on Reddit if you do make a donation. +## Support is only offered freely to those who donate $20 or more. +## Your donation contributes to further development. +## If you need a custom script, contact me on Reddit for pricing. + +if [[ -z $1 ]]; then + echo -n "Enter domain to add to Apache2 server as vhost: " + read domain +else + domain=$1 +fi + +echo "Creating web folder at /var/www/$domain/" +mkdir "/var/www/$domain" +touch "/var/www/$domain/index.html" +echo "
$domain is working!
" >> "/var/www/$domain/index.html" +chown -R www-data:www-data "/var/www/$domain" + +echo "Creating log folder at /var/log/apache2/$domain/" +mkdir "/var/log/apache2/$domain" +chown -R root:adm "/var/log/apache2/$domain" + +echo "Configuring Apache2" +touch "/etc/apache2/sites-available/$domain.conf" +echo "