vim /etc/nginx/sites-enabled/default
Remove listen [::]:80 default_server;
X-Frame-Options SAMEORIGIN
Configuring Apache
Header always append X-Frame-Options SAMEORIGIN
Configuring nginx
add_header X-Frame-Options SAMEORIGIN;
btrfs resize
btrfs filesystem resize max /some/path
node pm2 log create rotate
pm2 logrotate -u user
/home/user/.pm2/pm2.log /home/user/.pm2/logs/*.log {
rotate 12
weekly
missingok
notifempty
compress
delaycompress
create 0640 user user
}
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
telnet connect to rabbitmq password
rabbitmqctl authenticate_user username password
rabbitmq port 15672 not working
rabbitmq-plugins enable rabbitmq_management
install wazuh
curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | apt-key add –
echo “deb https://packages.wazuh.com/4.x/apt/ stable main” | tee -a /etc/apt/sources.list.d/wazuh.list
apt-get update
WAZUH_MANAGER=”10.0.0.2″ apt-get install wazuh-agent
elastic check version
curl -XGET 'http://localhost:9200'
kde create a notification
echo "notify-send 'Need to check kitchen in 10 min'"| at now + 10 minutes
test php timeout time
<?php sleep(90); $time = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"]; echo "PHP was running $time seconds\n";
crontab change editor
export EDITOR=vim
set expire_logs_days
mysql> SET GLOBAL expire_logs_days=7;
curl check status code
curl --write-out "%{http_code}\n" --silent --output /dev/null "$URL"
for URL in `cat domain_list.txt`; do printf "%s: " $URL; curl --write-out "%{http_code}\n" --silent --output /dev/null https://$URL ; done
crontab run for loops
0 0 * * * /bin/bash -c 'for file in $(/bin/find /some/path -name "*.log"); do /usr/bin/tee -a $file; done'