SELECT CONCAT("GRANT SELECT ON ",SCHEMA_NAME,".* TO 'test_user'@'localhost';")
FROM information_schema.SCHEMATA
WHERE SCHEMA_NAME NOT LIKE 'mysql';
Category Archives: Hosting
bash do not create file if empty result
tee empty file
use ifne
grep -ri website /etc/apache2 | ifne tee /tmp/outout.log
rm also can help:
grep -ri website /etc/apache2 > /tmp/outout.log ; [[ $? -ne 0 ]] && 'rm' -f /tmp/outout.log
curl list index elasticsearch
curl 'localhost:9200/_cat/indices?v'
nginx plugin certbot
apt install certbot python3-certbot-nginx
docker-compose latest version
VERSION=$(curl –silent https://api.github.com/repos/docker/compose/releases/latest | grep -Po ‘”tag_name”: “\K.*\d’)
curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
certbot cloudflare manual dns
certbot certonly --manual --server https://acme-v02.api.letsencrypt.org/directory --preferred-challenges dns-01 -d "*.
[ERROR] Exception occured: ISPConfigOSException -> Command mount -o remount
wget -O - https://get.ispconfig.org | sh -s --
[ERROR] Exception occured: ISPConfigOSException -> Command mount -o remount / 2>&1 && quotaoff -avug 2>&1 && quotacheck -avugm 2>&1 && quotaon -avug 2>&1 failed. (/ispconfig.ai.php:15)
Fix OpenVZ install issue
sed -i 's/mount -o remount/echo/' /tmp/ispconfig-ai/lib/os/class.ISPConfigDebianOS.inc.php
php -f /tmp/ispconfig-ai/ispconfig.ai.php
WARNING! This script will reconfigure your complete server!
It should be run on a freshly installed server and all current configuration that you have done will most likely be lost!
Type 'yes' if you really want to continue:
yes
SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
DEBIAN/UBUNTU
apt-get install ca-certificates
FEDORA/CENTOS
dnf install ca-certificates.noarch
yum install ca-certificates.noarch
X-Frame-Options SAMEORIGIN
Configuring Apache
Header always append X-Frame-Options SAMEORIGIN
Configuring nginx
add_header X-Frame-Options SAMEORIGIN;
apache change document root based on url
ServerName testdomain.com
ServerAlias *.testdomain.com
RewriteEngine on
RewriteMap lowercase int:tolower
RewriteCond ${lowercase:%{SERVER_NAME}} ^[a-z0-9-]+\.testdomain\.com$
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]
RewriteRule ^([a-z0-9-]+)\.testdomain\.com/(.*) /var/www/vhost/testdomain.com/httpdocs/$1/$2
test php timeout time
<?php sleep(90); $time = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"]; echo "PHP was running $time seconds\n";
directadmin AH01075: Error dispatching request to : (polling
echo 'ProxyTimeout 1800' >> /etc/httpd/conf/extra/httpd-includes.conf
service httpd restart
Invalid command ‘RewriteRule’
a2enmod rewrite
systemctl restart apache2
cPanel set hostname ssl certificate
/usr/local/cpanel/bin/checkallsslcerts –verbose
If checkallsslcerts is doing nothing
rm /var/cpanel/ssl/disable_auto_hostname_certificate
rm /var/cpanel/ssl/disable_service_certificate_management
show database collocation mysql
SELECT SCHEMA_NAME 'database', default_character_set_name 'charset', DEFAULT_COLLATION_NAME 'collation' FROM information_schema.SCHEMATA;