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 centos:centos6 | |
MAINTAINER jmorton@usgs.gov | |
# Apache | |
RUN yum install -y httpd httpd-devel | |
RUN chkconfig httpd on | |
RUN apachectl start | |
# Dependencies | |
RUN yum groupinstall -y "Development tools" |
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
#!/bin/bash | |
### Python | |
# Setup python from source, for multiple versions of it. This only works with whole version numbers, not alpha releases. | |
# CentOS requires these packages: | |
# sudo yum -y install gcc automake autoconf | |
# yum groupinstall -y "Development tools" | |
# yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline | |
# yum install -y tar | |
# sudo yum -y install readline-devel ncurses-devel openssl-devel sqlite-devel tk-devel gdbm-devel bzip2-devel |
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 datetime import datetime, date | |
from sqlalchemy.orm.query import Query | |
def render_query(statement, bind=None): | |
""" | |
Generate an SQL expression string with bound parameters rendered inline | |
for the given SQLAlchemy statement. | |
WARNING: This method of escaping is insecure, incomplete, and for debugging | |
purposes only. Executing SQL statements with inline-rendered user values is |
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 psycopg2 | |
import psycopg2.extensions | |
from select import select | |
from twisted.internet import threads | |
class AsyncNotify(): | |
""" | |
based on http://divillo.com/, adapted to newer psycopg version | |
Class to trigger a function via PostgreSQL NOTIFY messages. |
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 pyudev | |
from twisted.internet import abstract | |
class UDevMonitor(abstract.FileDescriptor): | |
""" | |
Protocol wrapper for pyudev.Monitor. | |
@see: U{http://packages.python.org/pyudev/api/monitor.html}. | |
""" |
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 python | |
# -*- coding: utf-8 -*- | |
# Buit-ins | |
import time | |
# PIP Installs | |
from celery.task import current, task | |
def super_long_process(c, max_count): |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: FastCGI servers for Django | |
# Required-Start: networking | |
# Required-Stop: networking | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: S 0 1 6 | |
# Short-Description: Start FastCGI servers with Django. | |
# Description: Django, in order to operate with FastCGI, must be started | |
# in a very specific way with manage.py. This must be done |
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
revert-file: | |
local.state.apply: | |
- tgt: {{ data['id'] }} | |
- kwarg: | |
saltenv: dev | |
- arg: | |
- maintain_important_file |
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
reactor: | |
- salt/beacon/*/inotify//tmp/important_file: | |
- /srv/reactor/revert.sls |
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
important_file: | |
file.managed: | |
- name: /tmp/important_file | |
- contents: | | |
important_config: True |
OlderNewer