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
# Wordpress Fabfile, for migrating the database, and deploying w/ git. | |
# For background: "My New & Improved Fabfile for Deploying WordPress" | |
# http://wp.me/p2a3Vy-1b | |
# | |
# This fabfile is specifically-geared for our unique setup, which consists | |
# of 2 servers (local, remote), and 3 sites (local, dev, and prod). Dev and | |
# prod sites both live on the remote server. | |
# | |
# In general, a little bit of the programming happens on a local site, | |
# but the database updates and file uploads (both in Wordpress, and edits |
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
/* | |
Proxy PAC Script to block the NYT paywall | |
========================================== | |
Save this file to your local machine (example: my_proxy_config.pac), and then search "[your browser] | |
automatic proxy configuration" to find out how to implement it with your browser. For Firefox, go to | |
Tools -> Options -> Advanced -> Network tab -> Connection box -> Settings, and select Automatic Proxy | |
Configuration URL, and use a format like this for the file: | |
file:///c:/users/me/Dropbox/bin/my_proxy_config.pac |
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
# Most important thing to import | |
from fabric.api import * | |
# Not necessary, but useful for making timestamps | |
import time | |
# Allows Fabric to use profiles from your ~/.ssh/config file | |
env.use_ssh_config = True | |
def prod(): |
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 | |
set -e | |
if [ "${VIRTUAL_ENV}" = "" ]; then | |
echo "Error: Not in a virtual env" | |
exit 1 | |
fi | |
OS=$(uname -s) |
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($, _window, undefined) { | |
$(document).ready(function () { | |
var $body = $('body'); | |
var $tmp = $('<span id="bs-visibility-tester"/>'); | |
var identifyBootstrapViewname = function (){ | |
$tmp.appendTo($body); | |
var visible_for; | |
$.each(['lg','md','sm','xs'], function(z, viewname){ | |
$tmp.addClass('visible-' + viewname); |
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
#!/usr/bin/python | |
import subprocess | |
from datetime import datetime | |
import time | |
import sys | |
import itertools | |
# Configurable Values | |
MEM_LIMIT = 600000 |
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
#!/usr/env python | |
""" | |
Fetches a set of placeholder images from placehold.it. Iterates over the background colors specified, and | |
uses the same text for each slide. Image filenames contain an index, the size, and the bg color. | |
Warning: quick/dirty script. Would be cooler if options could be entered on the command-line. Also would | |
probably be cooler to use the subprocess module, instead of os.system() | |
""" | |
import os |
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
#!/usr/bin/python | |
""" | |
This script is intended to run infinitely (ctrl-c to exit). It executes a "ps" command, and then | |
parses the result to determine the total memory usage for a given user account. It will output a | |
warning message if that value exceeds a specified threshold. | |
The following values can be configured: | |
USER - the account to be watched. The $USER bash environment variable is the default. | |
MEM_WARNING_LEVEL - warning message will be shown if current usage is above this |
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 | |
# This script is intended to be executed from the root directory of | |
# the extracted Nginx ZIP file. The ZIP file is available http://nginx.org/en/download.html | |
# The Nginx config dir will be ~/etc/nginx. | |
# The default HTML directory will be ~/htdocs/html. | |
# | |
# IMPORTANT NOTE: this script makes an attempt to be "upgrade-friendly". It backs up | |
# up the existing nginx directory, prior to upgrading, and also makes a copy of the | |
# existing ~/etc/nginx/nginx.conf file. | |
# |
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
# For reference, see: | |
# - http://docs.fabfile.org/en/1.12.0/usage/tasks.html#new-style-tasks | |
# - http://docs.fabfile.org/en/1.12.0/api/core/tasks.html | |
# - http://docs.fabfile.org/en/1.12.0/usage/execution.html#execute | |
from fabric.api import env, run, roles, execute | |
from fabric.tasks import Task | |
env.use_ssh_config = True | |
env.roledefs = { |
OlderNewer