Wes Winham winhamwr@gmail.com
There are many tutorials floating around the web that almost get you a dynamic VPN in EC2. The goal of this tutorial is to be a one-stop-shop for this specific setup.
#!/usr/bin/env python | |
import optparse, subprocess, logging, os, sys, shutil | |
APT_COMMAND = 'apt-get -o Dpkg::Options::="--force-confnew" -y --force-yes -qq install %s' | |
def apt_install(app): | |
logging.info("Calling: %s" % (APT_COMMAND % app)) | |
subprocess.call(APT_COMMAND % app, shell=True) |
/var/log/celery/*.log { | |
weekly | |
missingok | |
rotate 52 | |
compress | |
delaycompress | |
notifempty | |
copytruncate | |
} |
def build_document_pdf(document, realtime=False, timeout=None, watermark=True): | |
""" | |
Builds and caches a PDF copy of this document. | |
If ``realtime`` is True, returns the URL to the PDF. Otherwise, the PDF is | |
generated as asynchronously in the background. | |
""" | |
if not timeout: | |
timeout = print_settings.PRINTING_TIMEOUT | |
pdf_generator = DocumentPdfGenerator() |
#!/bin/bash | |
function main() | |
{ | |
monitor_from_file $* | |
} | |
function monitor_vpn_ip_port() | |
{ | |
local CONN_NAME=$1 |
""" | |
Celery base task aimed at longish-running jobs that return a result. | |
``AwesomeResultTask`` adds thundering herd avoidance, result caching, progress | |
reporting, error fallback and JSON encoding of results. | |
""" | |
from __future__ import division | |
import logging | |
import simplejson |
Wes Winham winhamwr@gmail.com
There are many tutorials floating around the web that almost get you a dynamic VPN in EC2. The goal of this tutorial is to be a one-stop-shop for this specific setup.
[group:kegbot] | |
programs=kegbot_core,kegboard_daemon,kegbot_runserver | |
[program:kegbot_core] | |
command=/opt/kegbot/env/bin/kegbot_core.py | |
directory=/opt/kegbot | |
user=kegbot | |
environment=HOME='/home/kegbot' | |
numprocs=1 | |
autostart=true |
/** | |
* WYMeditor : what you see is What You Mean web-based editor | |
* Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ | |
* Dual licensed under the MIT (MIT-license.txt) | |
* and GPL (GPL-license.txt) licenses. | |
* | |
* For further information visit: | |
* http://www.wymeditor.org/ | |
* | |
* File Name: |
/** | |
Automatically saves a policy every REFRESH milliseconds through AJAX, | |
but only when the .autosave form has changed. To use, add the class autosave | |
to your form. | |
Note: REFRESH must always be bigger than SAVE_TIMEOUT, otherwise a broken | |
save will cause deadlock for pending. | |
**/ | |
function processJson(data) { |
#! /bin/bash | |
# Sleep until we can successfully SSH into a vagrant box. | |
# eg. $ wait_for_vagrant devbox && vagrant ssh devbox --command 'cd project && ./manage.py runserver' | |
# Uses doublinng backoff while waiting | |
# with_backoff() adapted from http://stackoverflow.com/a/8351489 | |
# Retries a command a configurable number of times with backoff. | |
# | |
# The retry count is given by ATTEMPTS (default 5), the initial backoff |