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
Plugins I'm using: | |
https://github.com/sensu-plugins/sensu-plugins-load-checks | |
https://github.com/sensu-plugins/sensu-plugins-memory-checks | |
https://github.com/sensu-plugins/sensu-plugins-disk-checks | |
https://github.com/sensu-plugins/sensu-plugins-cpu-checks |
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
# NOTE: Needs it's own venv with latest psycopg2 | |
import os | |
import psycopg2 | |
from psycopg2.extras import DictCursor | |
import json | |
import time | |
import datetime | |
SLEEP_SECONDS = 10 |
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
# makes sure the DDT never turns on | |
def custom_show_toolbar(request): | |
return 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
Backup: $ pg_dump -U {user-name} {source_db} -f {dumpfilename.sql} | |
Restore: $ psql -U {user-name} -d {desintation_db} -f {dumpfilename.sql} |
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
from django import http | |
class NotAPageMiddleware(object): | |
""" | |
This middleware checks to see if the cms page is assigned to a specific template | |
and if so will redirect to the next published child page. Needs to be after the | |
cms page middleware. | |
""" | |
def process_response(self, request, response): | |
in_admin = request.path.split('/')[1] == "admin" |
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
import numpy as np | |
import locale | |
locale.setlocale(locale.LC_ALL, '') | |
def sliding_payment_fv(start_pmt=100, annual_pmt_increase=100, max_pmt=300, | |
years=10, interest_rate=0.05, present_value=100): | |
future_value = 0 | |
pmt = start_pmt | |
for year in range(years): |
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
PIL==1.1.7 | |
django==1.3 | |
django-filer==0.8.2 | |
easy-thumbnails==1.0-alpha-15 | |
cmsplugin-filer==0.8.0 | |
django-cms==2.2 | |
django-reversion==1.4 | |
django-debug-toolbar==0.8.4 | |
django-tinymce==1.5.1a1 | |
http://sourceforge.net/projects/mysql-python/files/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz/download |
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
# The GeoDjango installation page [1] makes the OSX setup seem kind of gnarly. homebrew has | |
# come a long way and can do a lot of the heavy lifting of building libs needed by GeoDjango. | |
# When I get some time I'll submit a patch to that page on the Django site with this info... | |
# [1] https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/#macosx | |
# Freshen homebrew | |
brew update | |
brew upgrade | |
# The main stuff we need |
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/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
NewerOlder