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
[www] | |
listen = /run/php/php7.4-fpm.sock | |
user = www-data | |
group = www-data | |
listen.owner = www-data | |
listen.group = www-data | |
pm = ondemand | |
pm.max_children = 2 | |
pm.process_idle_timeout = 10s | |
pm.max_requests = 100 |
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
## Jakke Lehtonen | |
## by several sources | |
## Varnish default.vcl for Wordpress, Woocommerce, LearnDash, PMPro, bbPress etc. | |
## Just for one domain and one server, but can use for several servers AFAIK | |
# | |
# Lets's start caching | |
# | |
# Marker to tell the VCL compiler that this VCL has been adapted to the 4.0 format. | |
vcl 4.0; |
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
# 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 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
map $http_user_agent $bad_bot { | |
default 0; | |
# libraries etc. | |
"~*(?:\b)aiohttp(?:\b)" 1; | |
"~*(?:\b)akka-http/(?:\b)" 1; # - done | |
"~*(?:\b)Amazon CloudFront(?:\b)" 1; # - done | |
"~*(?:\b)Facebot Twitterbot(?:\b)" 1; | |
"~*(?:\b)check_http/(?:\b)" 1; | |
"~*(?:\b)curl/(?:\b)" 1; | |
"~*(?:\b)Java/(?:\b)" 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 | |
DEVDIR="web/app/uploads/" | |
DEVSITE="https://example.dev" | |
PRODDIR="web@example.com:/srv/www/example.com/shared/uploads/" | |
PRODSITE="https://example.com" | |
STAGDIR="web@staging.example.com:/srv/www/example.com/shared/uploads/" | |
STAGSITE="https://staging.example.com" |
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
' Windows Devs said on the developer feedback asking for cron, deamons and background tasks: | |
' "This first release of Bash/WSL doesn’t support background tasks, cron jobs, daemons, etc. | |
' Currently, when you close your last bash shell console window, we tear-down the Linux process | |
' chain in order to conserve resources." | |
' | |
' That's the workaround for now. | |
' You can run it on boot, for example, and it'll keep a instance of bash running alone in the background | |
' allowing background processes to run on WSL. | |
Set WshShell = CreateObject("WScript.Shell") |
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
<?php | |
# Check: https://onexa.nl/wordpress/toolbar-link-redis-object-cache/ | |
/** | |
* Add a link to the Admin Toolbar to easily flush the Redis cache (Redis Object Cache plugin) | |
* | |
* @author Hiranthi Herlaar, onexa.nl | |
* | |
* @var $wp_admin_bar > https://codex.wordpress.org/Class_Reference/WP_Admin_Bar |
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
sub headers_x { | |
## Add after vcl 4.1; | |
## include "/etc/varnish/ext/cheshire_cat.vcl"; | |
## | |
## Add after sub vcl_deliver { | |
## call header_smiley; | |
sub header_smiley { | |
set resp.http.xa = "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀.'\⠀⠀⠀/`."; | |
set resp.http.xb = "⠀⠀⠀⠀⠀⠀⠀⠀⠀.'.-.`-'.-.`."; | |
set resp.http.xc = "⠀⠀⠀⠀..._:⠀⠀⠀.-.⠀.-.⠀⠀⠀:_..."; |
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
sub deliver_moomin { | |
set resp.http.x-moomin0 = "⠀⠀⠀⠀⠀⠀⠀⢠⢦⡀⠀⡰⣩⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀"; | |
set resp.http.x-moomin1 = "⠀⠀⠀⠀⠀⠀⠀⠘⣄⠙⠍⠁⠙⠦⡀⠀⠀⠀⠀⠀⠀⠀⠀"; | |
set resp.http.x-moomin2 = "⠀⠀⠀⠀⠀⠀⠀⠀⡎⠀⠀⡠⠄⠔⠊⠉⠒⠒⠒⢄⠀⠀⠀"; | |
set resp.http.x-moomin3 = "⠀⠀⠀⠀⠀⠀⠀⢀⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢈⠆⠀⠀"; | |
set resp.http.x-moomin4 = "⠀⠀⢠⢤⠜⡆⠀⢸⠀⠰⣄⠀⠀⠀⠀⠀⠀⠀⣠⠎⠀⠀⠀"; | |
set resp.http.x-moomin5 = "⠀⠀⠱⠤⡁⠈⠑⠇⠀⠀⠀⠉⠒⠤⠤⠄⢖⠊⠀⡐⠧⣄⣀"; | |
set resp.http.x-moomin6 = "⠀⠀⠀⠀⠘⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⡉⠀⣀⣨⡷"; | |
set resp.http.x-moomin7 = "⠀⠀⠀⠀⠀⠈⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢱⠜⠁ "; | |
set resp.http.x-moomin8 = "⠀⠀⠀⠀⠀⠀⢇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣸⠱⡀⠀"; |
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
add_filter( 'upload_mimes', 'my_mime_types', 1, 1 ); | |
function my_mime_types( $mime_types ) { | |
$mime_types['jpg|jpeg|jpe'] = 'image/jpeg'; | |
$mime_types['gif'] = 'image/gif'; | |
$mime_types['png'] = 'image/png'; | |
$mime_types['bmp'] = 'image/bmp'; | |
$mime_types['tiff|tif'] = 'image/tiff'; | |
$mime_types['ico'] = 'image/x-icon'; | |
$mime_types['asf|asx'] = 'video/x-ms-asf'; |