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
location ~* \.(png|jpe?g|gif|ico)$ { | |
expires 24h; | |
log_not_found off; | |
try_files $uri $uri/ @production; | |
} | |
location @production { | |
resolver 8.8.8.8; | |
proxy_pass https://example.com/$uri; | |
} |
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
# Use live site assets. | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f [NC] | |
RewriteCond %{HTTP_HOST} ^local\.com$ | |
RewriteRule ^(.*\.(png|jpe?g|gif)) http://production.com/$1 [L,R=302,NC] | |
</IfModule> |
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
DELETE pm | |
FROM wp_postmeta pm | |
LEFT JOIN wp_posts p ON p.ID = pm.post_id | |
WHERE p.ID IS NULL |
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
location ~ ^/wp-content/uploads/(.*) { | |
if (!-f $request_filename) { | |
rewrite ^/wp-content/uploads/(.*)$ http://EXTERNAL_URL/wp-content/uploads/$1 redirect; | |
} | |
} |
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
# Be sure to comment out the /files rules in /vagrant/config/nginx-config/nginx-wp-common.conf | |
# then add this to the bottom of the your /vagrant/config/nginx-config/sites/domain.conf | |
# replace 'domain' with the domain associated with your project | |
if ($http_host ~ (.*)\.domain\.dev) { | |
set $subdomain $1; | |
} | |
location ~ ^/files/(.*) { | |
rewrite ^/files/(.*)$ http://$subdomain.domain.com/files/$1 redirect; | |
} |
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 | |
# | |
# Author: Peter Toi | |
# Source: https://gist.github.com/petertoi/8f7e42b867cbb85ec47b | |
# | |
# Usage 1: $ digall.sh # No argument will prompt for domain | |
# Usage 2: $ digall.sh domain # Skip the prompts by including the domain as an argument | |
if [ "$#" -eq 1 ] | |
then |
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 | |
NODEVERSION=v0.12.2 | |
SRCPATH=$HOME/src/node | |
LOCALPATH=$HOME/usr/local | |
BINPATH=$LOCALPATH/bin | |
mkdir -p $SRCPATH | |
mkdir -p $LOCALPATH |
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 | |
# | |
# Author: Peter Toi | |
# Source: https://gist.github.com/petertoi/23d072d1d8589d9f5386 | |
# | |
# Usage 1: $ injectionscan.sh | |
rm -fr injections.txt | |
touch injections.txt |
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 | |
# | |
# Author: Peter Toi | |
# Source: https://gist.github.com/petertoi/79d77b041f1f8f93c456 | |
# | |
# Usage 1: $ check_plugin_version.sh # No argument will prompt for plugin file name | |
# Usage 2: $ check_plugin_version.sh pluginfile # Skip the prompts by including the file name as an argument | |
if [ "$#" -eq 1 ] | |
then |
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 | |
# | |
# Author: Peter Toi | |
# Source: https://gist.github.com/petertoi/b61ac28f2cd27a2c645d | |
# | |
# Usage 1: $ wgetseq.sh # No argument will result in prompts | |
# Usage 2: $ wgetseq.sh starturl endurl startnum endnum # Skip the prompts by including the arguments | |
if [ "$#" -eq 4 ] | |
then |
NewerOlder