Skip to content

Instantly share code, notes, and snippets.

Philipp Keller philippkeller

Block or report user

Report or block philippkeller

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@philippkeller
philippkeller / ms-regionen.md
Last active Nov 10, 2018
How to upload MS-Regionen of Switzerland to Metabase
View ms-regionen.md
@philippkeller
philippkeller / flatten.py
Created Oct 18, 2018
flatten json using flatten_json
View flatten.py
#!/usr/bin/env python3
import flatten_json
import sys
import json
if __name__ == '__main__':
if len(sys.argv) < 3:
print(f'usage: {sys.argv[0]} in.csv out.csv')
f_out = open(sys.argv[2], 'w')
View getting-started-with-superset-airbnb-data-exploration-platform.md

Getting Started With Superset: Airbnb’s data exploration platform

These instructions are for Amazon Linux Version 2

Update Python and PIP versions on EC2 (Amazon AMI)

sudo yum update -y
sudo yum install python3 -y
@philippkeller
philippkeller / ami-mappings.yaml
Created Feb 16, 2018
Amazon Linux 64bit as of Feb 2018 (for acloudguru AWS cloudformation course)
View ami-mappings.yaml
Mappings:
RegionMap:
ap-south-1:
"AMALINUX" : "ami-531a4c3c"
eu-west-3:
"AMALINUX" : "ami-8ee056f3"
eu-west-2:
"AMALINUX" : "ami-403e2524"
eu-west-1:
"AMALINUX" : "ami-d834aba1"
@philippkeller
philippkeller / scanbd.conf
Created Jan 19, 2018
initial scanbd.conf
View scanbd.conf
/*
* $Id: scanbd.conf 213 2015-10-05 06:52:50Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2015 Wilhelm Meier (wilhelm.meier@fh-kl.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@philippkeller
philippkeller / scanbd.conf
Last active Jan 19, 2018
sample scanbd.conf
View scanbd.conf
global {
# log to console. put to 'false' once you're done with testing
debug = true
# 1=error, 2=warn, 3=info, 4-7=debug
# 3 was sufficient for me (shows when script is triggered)
debug-level = 3
scriptdir = /etc/scanbd/scripts
View memleak.py
import time
import tracemalloc
import pympler.muppy, pympler.summary
import gc
import sys
tracemalloc.start()
collection = []
start = time.time()
@philippkeller
philippkeller / interval_count.py
Created Dec 30, 2017
Stackoverflow count warm/cold by 5 minute interval
View interval_count.py
import datetime
with open("myfile.csv") as f:
window_from = None
window_to = None
warm = cold = 0
for line in f:
milliseconds, topics = line.split(",")
if milliseconds == 'milliseconds':
continue
View test_min_value.sh
min=40000
for i in {1..10000}; do
a=$(./test)
min=$((a<min?a:min));
done
echo $min
View queue_and_workers_read_file_example.py
import multiprocessing
import queue
import time
def worker(input, output):
for line in iter(input.get, None):
output.put(len(line))
if __name__ == '__main__':
num_processes = 3
You can’t perform that action at this time.