Skip to content

Instantly share code, notes, and snippets.

View tafaust's full-sized avatar
💻
Coding

Thomas Faust tafaust

💻
Coding
View GitHub Profile
@tafaust
tafaust / hidraw_read.py
Created March 11, 2018 17:42
Debug hidraw through hipdapi in linux python 3.6
#!/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.
"""
@tafaust
tafaust / masternode_kill_processes.sh
Created June 23, 2017 08:55
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/
#!/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