Skip to content

Instantly share code, notes, and snippets.

View mark-kubacki's full-sized avatar
🎏

Mark Kubacki mark-kubacki

🎏
  • Germany, European Union
View GitHub Profile
@mark-kubacki
mark-kubacki / mailing.py
Created September 20, 2011 15:47
Modul zum Versenden von Emails
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email.header import Header
from email.Utils import COMMASPACE, formatdate
from email import Encoders
try:
import turbomail
@mark-kubacki
mark-kubacki / fakemail.py
Created September 20, 2011 15:52
Dummy Email Server (genauer MTA)
#!/usr/bin/env python
#
# fakemail (Python version)
#
# $Id: fakemail.py,v 1.4 2011/06/09 16:57:10 ashtong Exp $
import asyncore
import getopt
import os
@mark-kubacki
mark-kubacki / limited_csv_fun.py
Created September 20, 2011 16:05
Beispiel: CSV Dateien einlesen
import csv
__all__ = ['read_csv_file']
def unicode_csv_reader(utf8_data, dialect=csv.excel, **kwargs):
csv_reader = csv.reader(utf8_data, dialect=dialect, **kwargs)
for row in csv_reader:
yield [unicode(cell, 'utf-8', errors='ignore') for cell in row]
def read_csv_file(filename):
@mark-kubacki
mark-kubacki / gist:1379050
Created November 19, 2011 16:57 — forked from j2labs/gist:1042778
JSON speed test with many implementations
#!/usr/bin/env python
# The output geneally looks like this:
#
# $ ./serialization.py
# Dumping:
# json: 6.40960884094
# simplejson: 6.82945179939
# cjson: 2.23045802116
# ujson: 0.806604146957
## Syntax highlighting of HTML with mixed-ins, for the editor Nano.
##
syntax "html" "\.(html|mak)$"
magic "HTML document text"
color brightblue start="<" end=">"
color red "&[^;[[:space:]]]*;"
# AngularJS and similar
color brightwhite start="\{\{" end="\}\}"
color green "ng-[^>\"\ \=]*"
color green start="ng-[^>\"\ \=]*\=\"" end="\""
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/iconsets/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
@mark-kubacki
mark-kubacki / fields.go
Last active August 29, 2015 14:05
how to accept incoming email utilizing services of Mailgun
func BindHexEncodedField(field *[]byte) func(string, []string, binding.Errors) binding.Errors {
return func(fieldName string, formVals []string, errs binding.Errors) binding.Errors {
var err error
*field, err = hex.DecodeString(formVals[0])
if err != nil {
errs.Add([]string{fieldName}, binding.DeserializationError, err.Error())
}
return errs
}
}
@mark-kubacki
mark-kubacki / create-all.sh
Last active September 21, 2023 07:50
a dummy Certificate Authority for development and testing
#!/bin/bash
#
# Copyright (c) 2015 W. Mark Kubacki <wmark@hurrikane.de>
# Licensed under the terms of the RPL 1.5 for all usages
# http://www.opensource.org/licenses/rpl1.5
#
set -e -o pipefail
CAsubj="/C=DE/ST=Niedersachsen/L=Hannover/O=Dummy CA/CN=Sign-It-All"
@mark-kubacki
mark-kubacki / get-video.sh
Last active October 6, 2016 19:26
gets videos from the internet and stores them as MKV
#!/bin/bash
#
# Gets videos, for example from YouTube, as best-quality separate tracks
# and stitches them, video by video, into a MKV – avoiding excess clutter files.
#
# wrapper to: mkvtoolnix youtube-dl iconv jq file
#
# author: W-Mark Kubacki <wmark@hurrikane.de>
set -e -o pipefail