# middleware to add GNU Terry Pratchett to django | |
# point to this class in your MIDDLEWARE_CLASSES | |
class GNUTerryPratchett(object): | |
@staticmethod | |
def process_response(request, response): | |
response['X-Clacks-Overhead'] = 'GNU Terry Pratchett' | |
return response |
--- | |
# ^^^ YAML documents must begin with the document separator "---" | |
# | |
#### Example docblock, I like to put a descriptive comment at the top of my | |
#### playbooks. | |
# | |
# Overview: Playbook to bootstrap a new host for configuration management. | |
# Applies to: production | |
# Description: | |
# Ensures that a host is configured for management with Ansible. |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "precise32" |
Python script to clone an existing VPC route table. Script output is a series of AWS CLI calls to create the route table and assign routes.
Update AWS_TARGET_REGION
and SOURCE_ROUTE_TABLE_ID
to suit.
Note: does not currently support NAT Gateway routes due to Boto 2 API limitation.
./clone-route-table.py
server { | |
listen 80; | |
server_name mydomain.org; | |
root /var/www; | |
access_log off; | |
error_log /home/user/geonode/log/nginx_error.log; |
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
Apple has released support for bootcamping Windows 10, but only on 2012 Macs and later. Despite not being supported. it is possible to install Windows 10 on earlier iMacs and it seems to run quite well.
IMPORTANT: Unplug all external and physical hard drives (where possible) that you won't be installing to to avoid accidentally erasing them. Also make note of which drives and partitions remain (e.g. System and Storage hard drives), and be super careful to not erase the wrong one.
RECOVERY: If you nuke your machine, restore your time machine backup. Instructions here.
using System; | |
using System.Net; | |
using System.IO; | |
using System.IO.Compression; | |
using System.Collections.Generic; | |
using System.Text.RegularExpressions; | |
using System.Diagnostics; | |
using System.Text; | |
using System.Security.Cryptography; | |
using System.Security.Permissions; |