This file contains hidden or 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
| # Varnish | |
| check program varnishpanic with path "/bin/varnishadm panic.show" | |
| if status != 1 then alert | |
| check process varnish with pidfile /var/run/varnish.pid | |
| #start program = "/etc/init.d/varnish start" with timeout 30 seconds | |
| #stop program = "/etc/init.d/varnish stop" | |
| start program = "/usr/bin/systemctl start varnish" with timeout 30 seconds | |
| stop program = "/usr/bin/systemctl stop varnish" | |
| if failed host 127.0.0.1 port 80 protocol http |
This file contains hidden or 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
| ### example.tld | |
| check host example.tld with address www.example.tld | |
| # ICMP check | |
| if failed icmp type echo | |
| for 2 times within 2 cycles | |
| then alert | |
| # HTTP check | |
| if failed port 80 protocol http |
This file contains hidden or 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
| # Apache2 | |
| check process apache2 with pidfile /var/run/apache2/apache2.pid | |
| group www-data | |
| start program = "/bin/systemctl start apache2" with timeout 30 seconds | |
| stop program = "/bin/systemctl stop apache2" | |
| if failed host localhost port 80 with protocol http | |
| and request "/server-status" for 2 times within 2 cycles then restart | |
| depend apache_bin | |
| depend apache_rc | |
This file contains hidden or 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
| ### example.tld | |
| check host example.tld with address www.example.tld | |
| # ICMP check | |
| if failed icmp type echo | |
| for 2 times within 2 cycles | |
| then alert | |
| # HTTP check | |
| if failed port 80 protocol http |
This file contains hidden or 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
| set daemon 60 #check services every 60 seconds | |
| set logfile /var/log/monit.log | |
| set idfile /var/lib/monit/id | |
| set statefile /var/lib/monit/state | |
| #Event queue | |
| set eventqueue | |
| basedir /var/lib/monit/events # set the base directory where events will be stored | |
| slots 100 # optionally limit the queue size |
This file contains hidden or 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
| /** | |
| * add this in the functions.php of theme/child theme/snippets plugin | |
| * Schedule the daily event if necessary. | |
| */ | |
| function schedule_delete_expired_coupons() { | |
| if ( ! wp_next_scheduled( 'delete_expired_coupons' ) ) { | |
| wp_schedule_event( time(), 'daily', 'delete_expired_coupons' ); | |
| } | |
| } | |
| add_action( 'init', 'schedule_delete_expired_coupons' ); |
This file contains hidden or 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
| <VirtualHost 127.0.0.1:8080> | |
| ServerAdmin email@example.com | |
| ServerName example.com | |
| ServerAlias www.example.com | |
| DocumentRoot /var/www/html | |
| ErrorLog ${APACHE_LOG_DIR}/error.log | |
| CustomLog ${APACHE_LOG_DIR}/access.log combined | |
This file contains hidden or 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 | |
| for post in $(wp post list --field=ID) | |
| do | |
| count=$(wp post term list $post 'category' --fields='name' --format="count") | |
| if [ "$count" -gt "1" ] | |
| then wp post term remove $post category 'yleinen' | |
| fi | |
| done | |
| ## chmod 755 poista-yleinen.sh |
This file contains hidden or 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 | |
| for post in $(wp post list --field=ID) | |
| do | |
| count=$(wp post term list $post 'category' --fields='name' --format="count") | |
| if [ "$count" -gt "1" ] | |
| then wp post term remove $post category 'uncategorized' | |
| fi | |
| done | |
| ## chmod 755 remove-category.sh |
This file contains hidden or 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
| # Rewriting on | |
| RewriteEngine on | |
| # redirect to same page in the new site as where a user was in the old site | |
| RewriteBase / | |
| RewriteCond %{SERVER_NAME} =old-domain.com [OR] | |
| RewriteCond %{SERVER_NAME} =new-domain.com | |
| RewriteRule ^ http://new.domain.com%{REQUEST_URI} [END,NE,R=301] |