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
server { | |
listen *:80; | |
location = /crossdomain.xml { | |
root /var/www/html/; | |
} | |
location = /test.html { | |
root /var/www/html/; | |
} |
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
server { | |
# Redirect yoursite.com to www.yoursite.com | |
server_name yoursite.com; | |
rewrite ^(.*) http://www.yoursite.com$1 permanent; | |
} | |
server { | |
# Tell nginx to handle requests for the www.yoursite.com domain | |
server_name www.yoursite.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
# HAProxy configuration - haproxy-db.cfg | |
## | |
## FRONTEND ## | |
## | |
# Load-balanced IPs for DB writes and reads | |
# | |
frontend db_write | |
bind 172.16.0.50:3306 |
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
(function(d) { | |
var dl = d.createElement('a'); | |
dl.innerText = 'Download MP3'; | |
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1]; | |
dl.download = d.querySelector('em').innerText+".mp3"; | |
d.querySelector('.primary').appendChild(dl); | |
dl.style.marginLeft = '10px'; | |
dl.style.color = 'red'; | |
dl.style.fontWeight = 700; | |
})(document); |
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 | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out myssl.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key myssl.key -out myssl.csr | |
echo "Removing passphrase from key (for nginx)..." | |
cp myssl.key myssl.key.org | |
openssl rsa -in myssl.key.org -out myssl.key |
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 | |
/* | |
Author: Jim Westergren & Jeedo Aquino | |
File: index-with-redis.php | |
Updated: 2012-10-25 | |
This is a redis caching system for wordpress. | |
see more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/ |
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 | |
export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY | |
export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY | |
export PASSPHRASE=YOU_PASSHRASE | |
# directories, space separated | |
SOURCE="/home/thomas/backup /home/thomas/bin /home/thomas/documents" | |
BUCKET=s3+http://mybucket | |
LOGFILE=/home/thomas/tmp/duplicity.log | |
# set email to receive a backup report |
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 | |
add_filter( 'script_loader_src', 'my_script_loader_filter' ); | |
/** | |
* function for filter 'script_loader_src' it echo's a script-tag with it's src empty. the src is kept in data-src so javascript can put in the src-attr on a later moment. (e.g. after a cookie-check) | |
* | |
* @author Floris P. Lof | |
* @params String $src the current source of the scriptfile to be included | |
* @return Boolean false | |
*/ |
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
user www-data; | |
worker_processes 4; # number of cores on machine | |
error_log /var/log/nginx/error.log; | |
events { | |
worker_connections 1024; | |
} | |
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
# encoding: utf-8 | |
import os | |
import shelve | |
import boto.glacier | |
import boto | |
from boto.glacier.exceptions import UnexpectedHTTPResponseError | |
ACCESS_KEY_ID = "XXXXXXXXXXXXX" | |
SECRET_ACCESS_KEY = "XXXXXXXXXXX" | |
SHELVE_FILE = os.path.expanduser("~/.glaciervault.db") |
OlderNewer