Skip to content

Instantly share code, notes, and snippets.

Thomas Andreas Hesse tahesse

Block or report user

Report or block tahesse

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
@tahesse
tahesse / type_enforcement.py
Created Mar 13, 2018
Python 3.6 type «enforcement» (/ check) through annotations or custom list of types
View type_enforcement.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging.config
import functools
from typing import Callable, Union
__author__ = 'Thomas Hesse'
@tahesse
tahesse / hidraw_read.py
Created Mar 11, 2018
Debug hidraw through hipdapi in linux python 3.6
View hidraw_read.py
#!/usr/bin/env python
"""Debug hidapi python library and hid devices.
You may use this utility script for debugging purposes to check if this library does work as
intended, thus detecting all plugged hid devices.
This files does also provide you with the vendor_id and product_id required by the udev rule.
"""
@tahesse
tahesse / masternode_kill_processes.sh
Created Jun 23, 2017
Shell script to terminate all services started by DC/OS that run on the master node. Source: https://dcos.io/docs/1.9/installing/ports/
View masternode_kill_processes.sh
#!/usr/bin/bash
killall nginx 2>/dev/null && echo "Killing nginx service on ports 80, 443"
for port in {53,1050,1801,2181,5050,7070,8080,8123,8181,9990,15055,15101,15201}; do
kill -9 $(netstat -tlnp | awk "/:$port */ {split(\$NF,a,\"/\"); print a[1]}") 2>/dev/null && echo "Killing service that runs on port $port"
done
You can’t perform that action at this time.