Skip to content

Instantly share code, notes, and snippets.

@mmaloney
mmaloney / webserver.py
Created August 6, 2014 16:38
Python Web Server
import sys, getopt
import SimpleHTTPServer, SocketServer
import datetime, time
import logging
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def log_message(self, format, *args):
open(logfile, "a").write("%s - - PythonWebApp - - [%s] %s\n" %
(self.address_string(),
@mmaloney
mmaloney / webserver.json
Last active May 23, 2016 08:31
Python Web Server Application Template
{
"ID": "",
"Name": "Python Web Server",
"Description": "Python Web Server",
"Services": [
{
"Name": "Python Web Server",
"Command": "",
"Description": "Python Web Server",
"Tags": null,
@mmaloney
mmaloney / webserver.json
Created August 4, 2014 23:00
Simple Python Web Server Template
{
"ID": "",
"Name": "Python Web Server",
"Description": "Simple Python web server",
"Services": [
{
"Name": "webserver",
"Command": "",
"Description": "Python web server",
"Tags": null,
@mmaloney
mmaloney / logging.yml
Created August 3, 2014 04:54
elasticsearch logging configuration
# you can override this using by setting a system property, for example -Des.logger.level=DEBUG
es.logger.level: INFO
rootLogger: ${es.logger.level}, console, file
logger:
# log action execution errors for easier debugging
action: DEBUG
# reduce the logging for aws, too much is logged under the default INFO
com.amazonaws: WARN
# gateway
@mmaloney
mmaloney / elasticsearch.yml
Created August 3, 2014 04:53
elasticsearch configuration
##################### Elasticsearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# Elasticsearch comes with reasonable defaults for most settings,
@mmaloney
mmaloney / syslog.conf
Created August 3, 2014 04:52
logstash configuration
input {
######### To test supervisord items
#stdin {
# add_field => { "program" => "supervisord" }
#}
syslog {
port => 5514
type => syslog
}
file {
@mmaloney
mmaloney / nginx.conf
Created August 3, 2014 04:49
kibana configuration
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes 1;
daemon off;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
@mmaloney
mmaloney / loganalyzer_kibana_service.json
Created August 3, 2014 04:46
kibana service template
{
"Command": "/usr/sbin/nginx",
"Endpoints": [
{
"Name": "http",
"Application": "http",
"PortNumber": 80,
"Protocol": "tcp",
"Purpose": "export",
"AddressConfig": {
@mmaloney
mmaloney / loganalyzer_elasticsearch_service.json
Created August 3, 2014 04:46
elasticsearch service template
{
"Command":"/usr/share/elasticsearch/bin/elasticsearch -f -p /var/run/elasticsearch/elasticsearch.pid -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=/var/log/elasticsearch -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=/etc/elasticsearch",
"Endpoints": [
{
"Name": "http",
"Application": "elasticsearch",
"PortNumber": 9200,
"Protocol": "tcp",
"Purpose": "export"
},
@mmaloney
mmaloney / loganalyzer_logstash_service.json
Created August 3, 2014 04:44
logstash service template
{
"Command": "/opt/logstash/bin/logstash agent -f /etc/logstash/conf.d/",
"Endpoints": [
{
"Name": "http",
"Application": "http",
"PortNumber": 9200,
"Protocol": "tcp",
"Purpose": "import"
},