Skip to content

Instantly share code, notes, and snippets.

View searchzakir's full-sized avatar
💭
BillionEmails.com + StopSpoof.com

Zakir Shaikh searchzakir

💭
BillionEmails.com + StopSpoof.com
View GitHub Profile
@searchzakir
searchzakir / gist:9623cb076a89f994d2c1
Last active August 29, 2015 14:26 — forked from jamtur01/gist:4385673
Postfix grok filters
grok {
tags => "postfix/smtpd"
pattern => [ "%{POSTFIXSMTPDCONNECTS}",
"%{POSTFIXSMTPDACTIONS}",
"%{POSTFIXSMTPDTIMEOUTS}",
"%{POSTFIXSMTPDLOGIN}",
"." ]
named_captures_only => true
}
@searchzakir
searchzakir / gist:2fe421c98009c9e681d8
Last active August 29, 2015 14:26 — forked from jbrownsc/gist:4694258
Postfix Logstash Patterns and Config - First round Based on https://gist.github.com/4385673
input {
stdin { type => "file" }
#redis {
# data_type => 'list'
# host => 'localhost'
# key => 'logstash:beaver'
# type => 'redis-input-beaver'
#}
}
@searchzakir
searchzakir / gist:e8e39a2b07ebba94e9a8
Last active August 29, 2015 14:26 — forked from jbrownsc/gist:4694374
Postfix Grok for Logstash Based on previous patterns. I cast the "delay" field into an integer for stats analysis in Kibana I also split out a "Postfix Base" for DRY glory.
# Postfix stuff
QUEUEID (?:[A-F0-9]+|NOQUEUE)
EMAILADDRESSPART [a-zA-Z0-9_.+-=:]+
EMAILADDRESS %{EMAILADDRESSPART:local}@%{EMAILADDRESSPART:remote}
RELAY (?:%{HOSTNAME:relayhost}(?:\[%{IP:relayip}\](?::[0-9]+(.[0-9]+)?)?)?)
@searchzakir
searchzakir / csv2xlsx.py
Last active August 29, 2015 14:26 — forked from konrad/csv2xlsx.py
Converts a CSV (tab delimited) file to an Excel xlsx file
#!/usr/bin/env python
"""
FUNCTION: Converts a CSV (tab delimited) file to an Excel xlsx file.
Copyright (c) 2012, Konrad Foerstner <[email protected]>
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all
copies.
@searchzakir
searchzakir / postfix_grok_pattern
Last active August 29, 2015 14:26 — forked from brablc/postfix_grok_pattern
Logstash example configuration for parsing Postfix mail log files
# Postfix stuff based on https://gist.github.com/jbrownsc/4694374:
QUEUEID (?:[A-F0-9]+|NOQUEUE)
EMAILADDRESSPART [a-zA-Z0-9_.+-=:]+
EMAILADDRESS %{EMAILADDRESSPART:local}@%{EMAILADDRESSPART:remote}
RELAY (?:%{HOSTNAME:relayhost}(?:\[%{IP:relayip}\](?::[0-9]+(.[0-9]+)?)?)?)
POSREAL [0-9]+(.[0-9]+)?
DELAYS (%{POSREAL}[/]*)+
DSN %{NONNEGINT}.%{NONNEGINT}.%{NONNEGINT}
STATUS sent|deferred|bounced|expired
@searchzakir
searchzakir / fixing_perl_warning_setting_locale_failed.sh
Created November 1, 2012 11:50
fixing_perl_warning_setting_locale_failed.sh
#!/bin/bash
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
apt-get install locales
dpkg-reconfigure locales
@searchzakir
searchzakir / Hadoop_CCAH_Gyaan
Created September 18, 2012 07:31
CCAH Notes AND Hadoop Gyaan
CCAH Notes AND Hadoop Details:
Contributor: Zakir Shaikh | Operations Architect | Collective
##########################################################################################################################
@searchzakir
searchzakir / peepcode.rb
Created July 29, 2012 22:05 — forked from jmazzi/peepcode.rb
A script to download all Peepcode screencasts with ruby & wget (supports resume)
require 'mechanize'
@username = '[email protected]'
@password = 'hi2u'
@download_path = File.expand_path 'downloads'
@wget_cookie = File.expand_path(File.dirname(__FILE__)) + '/wget-cookies.txt'
unless File.directory? @download_path
puts "@{download_path} doesn't exist!"
exit