Skip to content

Instantly share code, notes, and snippets.


Thomas Andreas Hesse tahesse

View GitHub Profile
tahesse / toggletouchpad
Created Feb 21, 2021
Bash script to toggle touchpad state on X server
View toggletouchpad
# set your device name here (can be found through `xinput`)
touchpadDevice='SynPS/2 Synaptics TouchPad'
if [ ! -z "$1" ]; then
# set the device state via argument (must be 0 or 1)
# toggle the device state
tahesse / main.dart
Created Feb 6, 2021
How to check if Dart List contains certain object instance?
View main.dart
class Book {
String title;
void main() {
List<Book> bookList = [
tahesse /
Created Mar 13, 2018
Python 3.6 type «enforcement» (/ check) through annotations or custom list of types
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging.config
import functools
from typing import Callable, Union
__author__ = 'Thomas Hesse'
tahesse /
Created Mar 11, 2018
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.
tahesse /
Created Jun 23, 2017
Shell script to terminate all services started by DC/OS that run on the master node. Source:
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"