Skip to content

Instantly share code, notes, and snippets.

View Wimpje's full-sized avatar
🦕

Wim Wimpje

🦕
  • The Netherlands
View GitHub Profile
@Wimpje
Wimpje / iis.py
Created August 23, 2016 09:16 — forked from adamwitko/iis.py
Example Datadog IIS log line parser
import time
from datetime import datetime
def parse_iis(logger, line):
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) cs-host sc-status sc-substatus sc-win32-status time-taken
line_date, line_time, server_ip, cs_method, cs_uri_stem, cs_uri_query, server_port, cs_username, client_ip, cs_user_agent, cs_referer, cs_host, status_code, sub_status, win32_status, time_taken = line.split()
dt = datetime.strptime(line_date+"T"+line_time, "%Y-%m-%dT%H:%M:%S")
dt = time.mktime(dt.timetuple())
@Wimpje
Wimpje / ssl_puma.sh
Created October 20, 2017 11:18 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key