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/sh | |
# Check if user has root privileges | |
if [[ $EUID -ne 0 ]]; then | |
echo "You must run the script as root or using sudo" | |
exit 1 | |
fi | |
## Reconfigure Dash | |
echo "dash dash/sh boolean false" | debconf-set-selections |
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 | |
find /etc -type f -name "php.ini" -exec sed -i 's/output_buffering/;output_buffering/g' {} + | |
sudo -u www-data sed -i "s/output_buffering=.*/output_buffering='Off'/" /var/www/nextcloud/.user.ini | |
sudo -u www-data php /var/www/nextcloud/occ app:disable survey_client | |
sudo -u www-data php /var/www/nextcloud/occ app:disable firstrunwizard | |
sudo -u www-data php /var/www/nextcloud/occ app:enable admin_audit | |
sudo -u www-data php /var/www/nextcloud/occ app:enable files_pdfviewer | |
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on | |
nohup chown -R www-data:www-data /var/www/nextcloud & |
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
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; | |
# | |
# Custom headers and headers various browsers *should* be OK with but aren't | |
# | |
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; | |
# | |
# Tell client that this pre-flight info is valid for 20 days | |
# |
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
# version 2020 feb 24 | |
ssl_certificate /etc/letsencrypt/live/yardomain.org/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/yardomain.org/privkey.pem; | |
ssl_trusted_certificate /etc/letsencrypt/live/yardomain.org/chain.pem; | |
ssl_protocols TLSv1.2 TLSv1.3; | |
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; | |
ssl_prefer_server_ciphers off; |
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 | |
IP_TMP=/tmp/ip.tmp | |
IP_BLACKLIST=/etc/ip-blacklist.conf | |
IP_BLACKLIST_TMP=/tmp/ip-blacklist.tmp | |
IP_BLACKLIST_CUSTOM=/etc/ip-blacklist-custom.conf # optional | |
list="chinese nigerian russian lacnic exploited-servers" | |
BLACKLISTS=( | |
"http://www.projecthoneypot.org/list_of_ips.php?t=d&rss=1" # Project Honey Pot Directory of Dictionary Attacker IPs | |
# "http://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=1.1.1.1" # TOR Exit Nodes, who would refuse those accessing your server? | |
# "http://www.maxmind.com/en/anonymous_proxies" # MaxMind GeoIP Anonymous Proxies |
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
# To have port 80 requests go to their 443 equivalents for an entire webserver, put this file in /etc/nginx/conf.d/ | |
# Note that to specify the catch-all name or default server you | |
# need to use the *listen* directive, not the server_name directive! | |
# See also https://nginx.org/en/docs/http/request_processing.html | |
# | |
# - $host catches subdomain names. | |
# - 307 and 308 include both POST and GET request URIs. | |
# - 307 is Temporary, change to the Permanent 308 after thorough testing: # return 308 https://$host$request_uri; | |
server { |
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
# Being unsatisfied with the look of mc in console/terminal windows, I made this for my own use. | |
# Version 3.7, subject to change over the years.. <j@jult.nl> | |
# I N S T A L L | |
# Put this file (jult.ini) in either of these skin-directories: | |
# /etc/mc/skins/ | |
# /usr/share/mc/skins/ | |
# ~/.local/share/mc/skins/ |
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
# this is most of my /etc/postfix/main.cf file: | |
inet_protocols = all | |
inet_interfaces = all | |
recipient_delimiter = + | |
smtpd_banner = Blah ESMTP | |
empty_address_recipient = admin |
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 | |
# We create a new /tmp/block file first, then append to it | |
# the 'sleep 1's are inserted because we suffered from slow/delayed disk cache writes | |
# which often caused this script to skip or not entirely finish pasting lists | |
wget -qO - --limit-rate=1500k https://raw.githubusercontent.com/notracking/hosts-blocklists/master/hostnames.txt > /tmp/block | |
sleep 1 | |
wget -qO - --limit-rate=1500k https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts >> /tmp/block | |
sleep 1 |
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/sh | |
# backup files files from server to server using ssh/rsync | |
# encrypt heavily using openssl before transfer to less secure location | |
# create the files | |
tar -zcpf /somepath/etc.tar.gz -C / etc | |
# tar -cv --exclude='root/io'-f /somepath/root.tar -find /root ! -type l | |
mysqldump --dump-date -uwp_admin -pSomedbpass -h localhost wordprass > /somepath/zichtbaar.sql |