Add to your wp-config.php:
$host = 'http://' . $_SERVER['HTTP_HOST'] . '/blog/';
define('WP_HOME',$host);
define('WP_SITEURL',$host);
Next create a server.blog in /data/web/nginx:
<?php | |
header('Pragma: no-cache'); | |
header('Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate, proxy-revalidate'); | |
$command = 'nice -n 10 zcat -f "%s" | nice -n 10 /usr/bin/goaccess --real-os --std-geoip --http-protocol --http-method --no-progress -a 2>&1'; | |
$domain = $_SERVER["SERVER_NAME"]; | |
$url = $_SERVER["SCRIPT_NAME"]; | |
$log_files = array_filter(glob(sprintf('/var/log/apache2/%s-access.log*', $domain)), 'is_file'); |
location /wp { | |
root /data/web/public; | |
index index.php ; | |
location ~ \.php$ { | |
echo_exec @phpfpm; | |
} | |
} | |
rewrite ^.*/files/(.*)$ /wp/wp-includes/ms-files.php?file=$1 last; | |
if (!-e $request_filename) { |
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
# This is a scp wrapper which allows to scp data into 1 specific and restricted file | |
# Example usage: | |
# command="/usr/sbin/scp-wrapper /etc/hosts $SSH_ORIGINAL_COMMAND" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAmkHG1WCjC... | |
# |
class SlackWebHook(object): | |
def __init__(self, url): | |
self.url = url | |
self.opener = build_opener(HTTPHandler()) | |
def __post(self, payload): | |
payload_json = json.dumps(payload) | |
data = urlencode({"payload": payload_json}) | |
req = Request(self.url) |
#!/bin/bash | |
set -e | |
function die() { echo "$1"; exit 1; } | |
function action() { | |
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" | |
echo "@@@ $(date)" | |
echo "@@@ $1" | |
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" |
Add to your wp-config.php:
$host = 'http://' . $_SERVER['HTTP_HOST'] . '/blog/';
define('WP_HOME',$host);
define('WP_SITEURL',$host);
Next create a server.blog in /data/web/nginx:
#!/bin/bash | |
if [ "$#" -ne 1 ] || [ "x$1" == "x" ] ; then | |
echo "Usage: $0 <sitemap.xml>" | |
exit 0; | |
fi | |
if [ ! -f "$1" ]; then | |
echo "Sitemap file $1 not found! Exit!" | |
exit 1 |
curl -qs http://someonewhocares.org/hosts/ | grep -vE '^#' | grep ^127 | grep -v local | awk '{print $2}' | while read line; do echo "zone \"$line\" { type master; file "/etc/bind/db.empty"; };"; done >> named.conf.fake-zones |
#!/bin/bash | |
if [ "$#" -ne 1 ] || [ "x$1" == "x" ] ; then | |
echo "Usage: $0 <sitemap.xml>" | |
exit 0; | |
fi | |
if [ ! -f "$1" ]; then | |
echo "Sitemap file $1 not found! Exit!" | |
exit 1 |
#!/bin/bash | |
DOMAIN="$1" | |
OLD_DOMAIN="$2" | |
if [ "x$DOMAIN" == "x" ] || [ "x$OLD_DOMAIN" == "x" ] ; then | |
echo "Usage: $0 <new_domain> <old_domain> (no scheme://)" | |
exit 1 | |
fi | |
mysql -Be "UPDATE wp_posts SET guid = REPLACE(guid, 'http://$OLD_DOMAIN/', 'http://$DOMAIN/')" |