Skip to content

Instantly share code, notes, and snippets.

View fphammerle's full-sized avatar

Fabian Peter Hammerle fphammerle

View GitHub Profile
@fphammerle
fphammerle / gatttool-polar-h10.txt
Created April 8, 2017 10:01
bluez gatttool: receive heart rate notifications from polar h10 (bluetooth heart rate sensor)
$ sudo hcitool lescan
AA:BB:CC:DD:EE:FF Polar H10 ABCDEFGH
$ gatttool -t random --device=AA:BB:CC:DD:EE:FF --interactive
[AA:BB:CC:DD:EE:FF][LE]> connect
Attempting to connect to AA:BB:CC:DD:EE:FF
Connection successful
[AA:BB:CC:DD:EE:FF][LE]> primary
attr handle: 0x0001, end grp handle: 0x0009 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x000a, end grp handle: 0x000d uuid: 00001801-0000-1000-8000-00805f9b34fb
@fphammerle
fphammerle / ranger-screen.py
Last active July 22, 2016 19:09
ranger plugin: update gnu screen's working directory whenever the current directory in ranger changes
import os
import ranger.api
import subprocess
# https://github.com/ranger/ranger/wiki/Signals-and-Hooks
def ranger_signal_bind(signal_name):
def decorate(handler):
old_hook_ready = ranger.api.hook_ready
def hook_ready(fm):
fm.notify('%s %r' % (signal_name, handler))