Skip to content

Instantly share code, notes, and snippets.

@mschuett
mschuett / concurrent.py
Created October 9, 2018 15:04
Python 3 concurrent.futures module
#!/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
#
@mschuett
mschuett / .bash_aliases
Created October 17, 2016 13:08
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 October 12, 2015 15:32
JIRA Print Bookmarklet
(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 April 10, 2020 18:09
convert JSON to Key-Value
#! /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 14:36
tf 0.5.0 bug #1866 example
# 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 August 29, 2015 14:20
Get Elasticsearch index name from alias
#! /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 August 29, 2015 14:15
convert price data from http://www.davek.com.au/td/ to RegulatedNoise CSV
#!/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
@mschuett
mschuett / keybase.md
Created December 15, 2014 13:45
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: