Skip to content

Instantly share code, notes, and snippets.

@arx76
arx76 / nginx-directives-ispconfig
Created November 29, 2018 14:37 — forked from denvers/nginx-directives-ispconfig
Nginx directives for use in ISPConfig - Nginx PHP7 FPM
# Force non-www to www redirect
if ($host !~* ^www\.) {
rewrite ^(.*)$ $scheme://www.$host$1 permanent;
}
# Turn on SSL
# protip: https://mozilla.github.io/server-side-tls/ssl-config-generator/
ssl on;
add_header Strict-Transport-Security max-age=15768000;
@arx76
arx76 / example.com
Created November 26, 2018 18:57 — forked from 1hakr/example.com
Supercharge your NGIX config
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name example.com;
location /api/ {
# Rate Limiting
limit_req zone=reqlimit burst=20; # Max burst of request
@arx76
arx76 / back-res.sh
Created October 23, 2018 18:17 — forked from zekus/back-res.sh
a backup script for ispconfig-3
#!/bin/bash
version="0.9.4 from 2010-09-13"
# Always download the latest version here: http://www.eurosistems.ro/back-res
# Thanks or questions: http://www.howtoforge.com/forums/showthread.php?t=41609
#
# CHANGELOG:
# -----------------------------------------------------------------------------
# version 0.9.4 - 2010-09-13
# --------------------------
# Small fix: - Corrected small bug replaced tar with $TAR in the recovery line
@arx76
arx76 / ip_firewall_filter.rsc
Created October 10, 2018 11:02 — forked from SmartFinn/ip_firewall_filter.rsc
MikroTik (RouterOS) Zone-Based Firewall Example
# jan/29/2018 22: 4:17 by RouterOS 6.41
#
/interface list
add name=public comment="public network"
add name=local comment="local network"
add name=guest comment="guest network"
# Change the interfaces below to your own
/interface list member
add list=public interface=ether1
for i in rpcbind nfslock lldpad fcoe rpcidmapd; do service $i stop; chkconfig $i off; done
@arx76
arx76 / gist:375a6532e75ddc40d7f06c681e019bb4
Last active August 31, 2018 11:47
Enable root login for phpmyadmin - Ubuntu 18.04 with MariaDB
echo "update mysql.user set plugin = 'mysql_native_password' where user='root';" | mysql -u root
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_password';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
@arx76
arx76 / reset-mysql-root-pass.sh
Created June 9, 2018 16:13 — forked from fastmover/reset-mysql-root-pass.sh
Reset mysql root password on ubuntu setup with easy engine.
service mysql stop
mysqld_safe --skip-grant-tables > /dev/null 2>&1 &
mysql -u root -e "use mysql; update user set password=PASSWORD('NEW-PASSWORD') where User='root'; flush privileges;"
service mysql restart