Follow these steps to install graphite on OS X Mavericks.
- Homebrew
- Python 2.7
- Git
| """ | |
| Determine IPv4 addresses on a Linux machine via the socket interface. | |
| Thanks @bubthegreat the changes to make it Py2/3 compatible and the helpful | |
| code comments: https://gist.github.com/pklaus/289646#gistcomment-2396272 | |
| This version has all comments removed for brevity. | |
| """ | |
| import socket | |
| import array | |
| import struct | 
| from django.contrib.admin import widgets | |
| from django import forms | |
| from django.contrib import admin | |
| # create wrappers for overriding the queryset | |
| class ToWrapper(object): | |
| def __init__(self, to, manager): | |
| self.to = to | |
| self._default_manager = manager | 
| #!/usr/bin/env python | |
| import sys, paramiko | |
| if len(sys.argv) < 5: | |
| print "args missing" | |
| sys.exit(1) | |
| hostname = sys.argv[1] | |
| password = sys.argv[2] | 
| apt-get install xvfb | |
| apt-get install firefox | 
| _.mixin({ | |
| nl2br : function(str, is_xhtml){ | |
| var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br />' : '<br>'; | |
| return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2'); | |
| } | |
| }); | 
| XVFB=/usr/bin/Xvfb | |
| XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset" | |
| PIDFILE=/var/run/xvfb.pid | |
| case "$1" in | |
| start) | |
| echo -n "Starting virtual X frame buffer: Xvfb" | |
| start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS | |
| echo "." | |
| ;; | |
| stop) | 
| from django import http | |
| from django.conf import settings | |
| """ | |
| Put this file in a directory called, eg, 'middleware,' inside your django | |
| project. Make sure to create an __init__.py file in the directory so it can | |
| be included as a module. | |
| Set the values for | |
| XS_SHARING_ALLOWED_ORIGINS | |
| XS_SHARING_ALLOWED_METHODS | 
| """ | |
| Pseudo-random django secret key generator. | |
| - Does print SECRET key to terminal which can be seen as unsafe. | |
| """ | |
| import string | |
| import random | |
| from __future__ import print_function |