#!/usr/bin/env python
import os
import django
import logging_tree
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 ubuntu:14.04 | |
RUN apt-get update && \ | |
apt-get -yq install varnish libvarnishapi-dev build-essential pkg-config \ | |
libpcre3-dev automake autogen libtool libreadline6-dev \ | |
libeditline0 libeditline-dev python-docutils curl | |
RUN curl -sLO https://varnish-cache.org/_downloads/varnish-3.0.7.tgz && \ | |
tar xvzf varnish-3.0.7.tgz && cd varnish-3.0.7 && \ | |
./configure && make | |
RUN curl -sLO https://github.com/varnish/libvmod-header/archive/3.0.tar.gz && \ |
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
Table "public.logs_log" | |
Column | Type | Modifiers | |
--------------+--------------------------+------------------------------------------------------- | |
id | integer | not null default nextval('logs_log_id_seq'::regclass) | |
bot_id | integer | | |
timestamp | timestamp with time zone | not null | |
nick | character varying(255) | not null | |
text | text | not null | |
action | boolean | not null | |
command | character varying(50) | |
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 | |
"""Example of the speed-up allowed by logging's string handling""" | |
from __future__ import division | |
import logging | |
import string | |
import time | |
logger = logging.getLogger(__name__) | |
logger.addHandler(logging.StreamHandler()) | |
logger.setLevel(logging.INFO) |
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 __future__ import unicode_literals | |
import logging | |
# built-in attributes on LogRecord. Used to determine what is passed in `extras` | |
RESERVED_ATTRS = ( | |
'args', 'asctime', 'created', 'exc_info', 'exc_text', 'filename', | |
'funcName', 'levelname', 'levelno', 'lineno', 'module', | |
'msecs', 'message', 'msg', 'name', 'pathname', 'process', | |
'processName', 'relativeCreated', 'stack_info', 'thread', 'threadName') |
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 logging.config | |
import os | |
from django.utils.log import DEFAULT_LOGGING | |
# Disable Django's logging setup | |
LOGGING_CONFIG = None | |
LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper() | |
logging.config.dictConfig({ |
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
{% set branch = pillar.name.split('.', 1)[0] %} | |
{{ branch }} db: | |
salt.function: | |
- name: state.apply | |
- tgt: salt.example.local | |
- arg: | |
- projects.test.dbs.generate_from_template | |
- kwarg: | |
pillar: |
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
# -*- coding: utf-8 -*- | |
import os | |
# pip install boto3 psutil requests | |
import boto3 | |
import psutil | |
import requests | |
NAMESPACE = 'Sys' | |
os.environ.setdefault('AWS_DEFAULT_REGION', 'us-east-1') |
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
web: server.py |
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
# er/sites/site1.sls | |
SITE_ID: 14 | |
EMAIL: [email protected] | |
LOG_FILE_DIR: /var/log/er_site1 |