This file contains hidden or 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
| ############################################################################# | |
| # Documentation # | |
| ############################################################################# | |
| # Author: Todd Whiteman | |
| # Date: 16th March, 2009 | |
| # Verion: 2.0.0 | |
| # License: Public Domain - free to do as you wish | |
| # Homepage: http://twhiteman.netfirms.com/des.html | |
| # |
This file contains hidden or 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
| -- Lua 5.1+ base64 v3.0 (c) 2009 by Alex Kloss <[email protected]> | |
| -- licensed under the terms of the LGPL2 | |
| -- character table string | |
| local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | |
| -- encoding | |
| function enc(data) | |
| return ((data:gsub('.', function(x) | |
| local r,b='',x:byte() |
This file contains hidden or 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
| location /resize { | |
| alias /tmp/nginx/resize; | |
| set $width 150; | |
| set $height 100; | |
| set $dimens ""; | |
| if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) { | |
| set $width $1; | |
| set $height $2; | |
| set $image_path $3; |
This file contains hidden or 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
| #This is the "site config" for nginx | |
| upstream django { | |
| # Distribute requests to servers based on client IP. This keeps load | |
| # balancing fair but consistent per-client. In this instance we're | |
| # only using one uWGSI worker anyway. | |
| ip_hash; | |
| server unix:/tmp/uwsgi.sock; | |
| } | |
| server { |
This file contains hidden or 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 python | |
| # coding: utf-8 | |
| # http://musta.sh/2012-03-04/twisted-tcp-proxy.html | |
| import sys | |
| from twisted.internet import defer | |
| from twisted.internet import protocol | |
| from twisted.internet import reactor | |
| from twisted.python import log |
This file contains hidden or 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
| #! -*- Coding: utf-8 -*- | |
| from gevent import monkey | |
| monkey.patch_all() | |
| import gevent | |
| import time | |
| from envoy import run | |
| from sys import exit, argv | |
| import subprocess | |
| import pip |
This file contains hidden or 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
| """ Use watchdogs to make your code safer. (http://en.wikipedia.org/wiki/Watchdog_timer) | |
| Usage: | |
| with watchdog.Watchdog(duration = 1.0): | |
| # Some code which takes less than 1s | |
| # If it takes more, the exception Watchdog.Reset will be raised | |
| # To notify the watchdog the section is still alive, call the method | |
| # 'tick' to reset its internal timer. |
This file contains hidden or 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
| # Extension of http://www.yilmazhuseyin.com/blog/dev/create-thumbnails-imagefield-django/ | |
| # Note: image_folder and thumbnail_folder are both a callable (ie. a lambda that does a '/'.join()) | |
| class Image(Media): | |
| image = models.ImageField( | |
| upload_to=image_folder | |
| ) | |
| thumbnail = models.ImageField( |
This file contains hidden or 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 -x | |
| ## REST API JIRA KEY check | |
| #List of projects that do not require strict JIRA KEY commits | |
| #list in space and case-insensitive | |
| NON_STRICT="sports" | |
| # Authentication credentials | |
| username=root |