ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
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
| """:mod:`sqla_intlist` --- Portable integer list type for SQLAlchemy | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| See the docstring of :class:`IntegerList` type. | |
| """ | |
| import collections | |
| import io | |
| from sqlalchemy.dialects.postgresql import ARRAY |
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
| -- Make sure a presentation is opened in Keynote. If not, notify the user and stop. | |
| tell application "Keynote" | |
| if (front slideshow exists) = false then | |
| display alert "Unable to proceed." message "Please open a presentation in Keynote." | |
| return | |
| end if | |
| set extractBody to button returned of (display alert "Would you like to extract slide content too?" buttons {"Yes", "No"}) = "Yes" | |
| -- Target the front presentation. |
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
| export PROJECTS_HOME="$HOME/Projects" | |
| function has_virtualenv__() { | |
| if [[ ${PWD##$PROJECTS_HOME} != $PWD ]]; then | |
| IFS="/" read -ra ADDR <<< "${PWD##$PROJECTS_HOME}" | |
| venvname=${ADDR[1]} | |
| cur_env=${VIRTUAL_ENV##$WORKON_HOME} | |
| if [[ $venvname != "" ]] && [[ -d "$WORKON_HOME/$venvname" ]]; then | |
| if [[ ${cur_env:1} != $venvname ]]; then | |
| workon "$venvname" |
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
| export PROJECTS_HOME="$HOME/Projects" | |
| function has_virtualenv__() { | |
| if [[ "$VIRTUAL_ENV" == "" ]]; then | |
| if [[ $(dirname "`pwd`") == $PROJECTS_HOME ]]; then | |
| venvname=$(basename "`pwd`") | |
| if [[ -d "$WORKON_HOME/$venvname" ]]; then | |
| workon "$venvname" | |
| fi | |
| fi |
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/bash | |
| # Script for installing tmux on systems where you don't have root access. | |
| # tmux will be installed in $HOME/local/bin. | |
| # It's assumed that wget and a C/C++ compiler are installed. | |
| # exit on error | |
| set -e | |
| TMUX_VERSION=1.8 |
Below are some issues we encountered during our first real deployment of gevent. It is being used on one host to communicate over ethernet (ie, using raw ethernet packets) with approximately 700 PIC32 microprocessors, and it is used for communication between all of the services we have built (approximately 15 unique services running on two hosts).
- The majority of the issues we faced were caused by a particular service which communicates with a child process over
stdin/stdout. Not all of the issues were gevent specific (for example, when the child wasn't properlyselecting on stdout, the kernel was silently dropping data when its internal buffer filled up, even thoughfwritereported that the data had been written). - We are using
gevent-0.13.7withlibevent-2.0.x. I would like to be usinggevent-1.0, but it was causing some issues (I don't recall exactly what they were) on OS X, so we rolled back to 0.13.7. libevent-1.4.13-stable(packages with Debian stable 6.0.4) would, under moderate l
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
| import ast | |
| app = lambda name, *args: \ | |
| ast.Call( | |
| func=ast.Name(id=name, ctx=ast.Load(), lineno=0, col_offset=0), | |
| args=list(args), keywords=[], vararg=None, | |
| lineno=0, col_offset=0) | |
| abs = lambda arg, body: \ |
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
| import sys | |
| from werkzeug.datastructures import ImmutableDict, MultiDict | |
| from flask import request | |
| from flaskext.script import Manager | |
| from postfixmgmt import app, db, __version__ | |
| from postfixmgmt.forms import DomainAddForm | |
| manager = Manager(app) | |