Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Schütte mschuett

View GitHub Profile
@mschuett
mschuett / concurrent.py
Created Oct 9, 2018
Python 3 concurrent.futures module
View concurrent.py
#!/usr/bin/env python3
#
# some examples for the useful concurrent.futures module in Python 3
#
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor, wait, as_completed
#
# some dummy function to have a CPU-bound workload
#
View .bash_aliases
alias gitlog='git log --graph --pretty=format:'\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit'
alias gitpush='git pull --rebase --ff-only && git push'
@mschuett
mschuett / bookmarklet.js
Created Oct 12, 2015
JIRA Print Bookmarklet
View bookmarklet.js
(function() {
var version = "4.0.8dev";
console.log("Version: " + version);
var global = {};
global.isDev = /.*jira.atlassian.com\/secure\/RapidBoard.jspa\?.*projectKey=ANERDS.*/g.test(document.URL) // Jira
|| /.*pivotaltracker.com\/n\/projects\/510733.*/g.test(document.URL) // PivotTracker
|| (/.*trello.com\/.*/g.test(document.URL) && jQuery("span.js-member-name").text() == 'Bengt Brodersen'); // Trello
global.isProd = !global.isDev;
@mschuett
mschuett / flatten_json.py
Last active Apr 10, 2020
convert JSON to Key-Value
View flatten_json.py
#! /usr/bin/env python3
#
# script to convert JSON documents into plain key-value lines,
# formatted to be piped to zabbix_sender
#
# 20130927, martin.schuette@deck36.de
# 20200409, info@mschuette.name, change to Python 3
#
import json
import sys
@mschuett
mschuett / setup.tf
Created May 10, 2015
tf 0.5.0 bug #1866 example
View setup.tf
# AWS IAM user with policy
### Variables
variable "aws_access_key" {
description = "AWS Access Key"
}
variable "aws_secret_key" {
description = "AWS Secret Key"
}
@mschuett
mschuett / get_index.py
Last active Aug 29, 2015
Get Elasticsearch index name from alias
View get_index.py
#! /usr/bin/python2
#
# aux script to read elasticsearch aliases info and return real index name for given alias
#
# written for use with https://github.com/mallocator/Elasticsearch-Exporter which
# does not seem to work with aliases
#
# 2015, DECK36 GmbH & Co. KG, <martin.schuette@deck36.de>
import json
@mschuett
mschuett / conv_prices.py
Last active Aug 29, 2015
convert price data from http://www.davek.com.au/td/ to RegulatedNoise CSV
View conv_prices.py
#!/bin/env python
#
# Simple proof of concept how to convert TradeDangerous price data
# to RegulatedNoise CSV data.
#
# For use on the command line using stdin/stdout, e.g.:
# python conv_prices.py _Gen123.prices > _Gen123.csv
# python < conv_prices.py _Gen123.prices > _Gen123.csv
#
# Written by Martin Schuette <info@mschuette.name>, 2015
View keybase.md

Keybase proof

I hereby claim:

  • I am mschuett on github.
  • I am mschuett (https://keybase.io/mschuett) on keybase.
  • I have a public key whose fingerprint is B02E 58FC E8A7 7AB8 0709 F3D5 4DC5 E228 0A32 7754

To claim this, I am signing this object: