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
{ | |
"transform": { | |
"_position": [-76.51986, | |
486.9061 | |
], | |
"_rotation": 350.229431, | |
"_scale": 0.8118029 | |
}, | |
"rb2d": { | |
"px": -76.51986, |
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 | |
// Snippet [...] | |
// Use any provided domain name from request as the site URL without redirection | |
// Note: Your Apache/Nginx or whatever server has to be configured to serve any chosen domain names from same document root directory | |
if( isset($_SERVER['HTTP_HOST']) ) { | |
define('WP_HOME', "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}"); | |
define('WP_SITEURL', WP_HOME); | |
} |
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/bash | |
# Start Linux daemons by starting WSL on user logon | |
# | |
# Usage: | |
# 1) Edit and save this bash shell script as /root/.bin/start-services.sh AND MAKE IT EXECUTABLE (chmod +x) | |
# (or wherever but remember to use the correct path in Scheduled task argumrents) | |
# | |
# 2) Set up a Windows Scheduled task to run this script via wsl.exe on user logon; | |
# Action - Start Program |
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
# --- [SNIP] --- | |
# Special format by @krader1961 | |
# His comment: I use a format that provides a human readable local time and a seconds since the UNIX epoch at UTC: | |
LogFormat "%{%Y-%m-%dT%H:%M:%S}t %{sec}t.%{usec_frac}t %>s %{error_notes}e %D %B %h %{Host}i \"%r\" \"%{Referer}i\" \"%{User-Agent}i\"" krader_custom | |
# I think I've removed and recreaed his original timestamp part (or something) because it caused my Apache to crash | |
### USAGE: | |
# In the global or vhost config... | |
# CustomLog "/var/log/apache2/krader_custom_access_%Y-%m-%d.log" krader_custom |
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
# Set environment variables from request headers and add them to User-Agent header | |
# it's not much but it works | |
# Requirements: | |
# 1 - mod_setenvif (http://httpd.apache.org/docs/current/mod/mod_setenvif.html) | |
# 2 - mod_headers (http://httpd.apache.org/docs/current/mod/mod_headers.html) | |
<IfModule mod_setenvif.c> | |
# Add envirinment variables from a request header | |
SetEnvIf CF-Connecting-IP "^(.+)$" CF_Connecting_IP=$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
DEPRECATED CODE!!!!1!one!!1 | |
Please read the replies before using this code or commenting! | |
For a better solution, use the fail2ban's persistence SQLite database with long purge time. | |
See this answer on Server Fault StackExchange: https://serverfault.com/a/810798/72732 | |
[Definition] | |
# Option: actionstart | |
# Notes.: command executed once at the start of Fail2Ban. |
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 | |
/** | |
* Dynamically allocate memory based on image dimensions, bit-depth and channels | |
* Shamelessly stolen somewhere online years ago. | |
* Probably from https://alvarotrigo.com/blog/allocate-memory-on-the-fly-PHP-image-resizing/ | |
* | |
* @param string $filename Full path to a file supported by getimagesize() function | |
* @param int $tweak_factor Multiplier for tweaking required memory. 1.8 seems fine. More info: http://php.net/imagecreatefromjpeg#76968 | |
* @param string $original_name Used purely for reporting actual file name instead of uploaded temp file (e.g. /tmp/RaNd0m.tmp) |