Skip to content

Instantly share code, notes, and snippets.

input {
stdin { }
file {
type => "postfix"
path => ["/var/log/mail.*"]
}
}
filter {
if [type] == "postfix" {
@kobrinartem
kobrinartem / postfix_patterns
Last active August 29, 2015 13:58
postfix_patterns
# Syslog stuff
COMPONENT ([\w._\/%-]+)
COMPID postfix\/%{COMPONENT:component}(?:\[%{POSINT:pid}\])?
POSTFIX %{SYSLOGTIMESTAMP:timestamp} %{SYSLOGHOST:hostname} %{COMPID}: %{QUEUEID:queueid}?
# Milter
HELO (?:\[%{IP:helo}\]|%{HOST:helo}|%{DATA:helo})
MILTERCONNECT %{QUEUEID:qid}: milter-reject: CONNECT from %{RELAY:relay}: %{GREEDYDATA:milter_reason}; proto=%{WORD:proto}
MILTERUNKNOWN %{QUEUEID:qid}: milter-reject: UNKNOWN from %{RELAY:relay}: %{GREEDYDATA:milter_reason}; proto=%{WORD:proto}
#encoding=UTF-8
# Configuration files must begin with a line specifying the encoding
# of the the file.
# Instance such as prod01
set.INSTANCE=Shipper
# client abreviation such as kp for Kaiser
set.CLIENT=Logstash
set.RUBYLIB=C:\logstash-1.4.0\lib
@kobrinartem
kobrinartem / s3_safe_sync
Last active August 29, 2015 14:04
s3_safe_sync
AWS_ACCESS_KEY = 'XXXXXXXXXXX'
AWS_SECRET_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
import os
import random, string
import boto
from boto.s3.connection import S3Connection
import hashlib
from subprocess import call
# Windows AMIs don't have WinRM enabled by default -- this script will enable WinRM
# AND install 7-zip, curl and .NET 4 if its missing.
# Then use the EC2 tools to create a new AMI from the result, and you have a system
# that will execute user-data as a PowerShell script after the instance fires up!
# This has been tested on Windows 2008 SP2 64bits AMIs provided by Amazon
#
# Inject this as user-data of a Windows 2008 AMI, like this (edit the adminPassword to your needs):
#
# <powershell>
# Set-ExecutionPolicy Unrestricted
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates 1-, 2- or 3-tier network environment with 1, 2, or 3 Availability Zones (AZs)
Metadata:
cfn-lint:
config:
client.create_model(
ModelName=“Your model name”,
PrimaryContainer={
“Image”: <AWS_DEEP_LEARNING_CONTAINER_URI>,
“ModelDataUrl”: <MODEL_S3_LOCATION>,
“Environment”: {
“SAGEMAKER_PROGRAM”: “inference.py”,
“SAGEMAKER_SUBMIT_DIRECTORY”: “<INFERENCE_SCRIPT_S3_LOCATION>”,
“SAGEMAKER_CONTAINER_LOG_LEVEL”: “20”,
“SAGEMAKER_REGION”: <REGION>,