Skip to content

Instantly share code, notes, and snippets.

View jhagberg's full-sized avatar

Jonas Hagberg jhagberg

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jhagberg on github.
  • I am haggan (https://keybase.io/haggan) on keybase.
  • I have a public key ASCMjEzLU44gvwRoq2Qe0GaDqSSLLMXsqLyEYoESSt01Rgo

To claim this, I am signing this object:

@jhagberg
jhagberg / gist:4286a4e1d4104f0d4fefac0e42ac339a
Created April 14, 2019 15:52
npyscreen BufferPager move from Widget
#!/usr/bin/env python
# encoding: utf-8
"""
ExampleManaged.py
Created by Nicholas Cole on 2007-02-22.
"""
import npyscreen, curses
python3 gatttest.py
[4C:65:A8:D0:24:6C] Connected
[4C:65:A8:D0:24:6C] Resolved services
[4C:65:A8:D0:24:6C] Service [0000fe95-0000-1000-8000-00805f9b34fb]
[4C:65:A8:D0:24:6C] Characteristic [00000014-0000-1000-8000-00805f9b34fb]
[4C:65:A8:D0:24:6C] Characteristic [00000013-0000-1000-8000-00805f9b34fb]
[4C:65:A8:D0:24:6C] Characteristic [00000010-0000-1000-8000-00805f9b34fb]
[4C:65:A8:D0:24:6C] Characteristic [00000004-0000-1000-8000-00805f9b34fb]
[4C:65:A8:D0:24:6C] Characteristic [00000002-0000-1000-8000-00805f9b34fb]
[4C:65:A8:D0:24:6C] Characteristic [00000001-0000-1000-8000-00805f9b34fb]
@jhagberg
jhagberg / bluepyread.py
Created February 5, 2018 09:38
Mija Bluetoot temp reader Bluepy version
from bluepy import btle
class MyDelegate(btle.DefaultDelegate):
def __init__(self):
btle.DefaultDelegate.__init__(self)
# ... initialise here
def handleNotification(self, cHandle, data):
print("A notification was received: %s" %data)
# Initialisation -------
@jhagberg
jhagberg / read.py
Created January 19, 2018 12:33
MIija Bluetooth temphumsensor read out. using gatt
import gatt
manager = gatt.DeviceManager(adapter_name='hci0')
class AnyDevice(gatt.Device):
def connect_succeeded(self):
super().connect_succeeded()
print("[%s] Connected" % (self.mac_address))
def connect_failed(self, error):
#!/bin/sh
## Copyright (c) 2009 Data Intensive Cyberinfrastructure Foundation. All rights reserved.
## For full copyright notice please refer to files in the COPYRIGHT directory
## Written by Jean-Yves Nief of CCIN2P3 and copyright assigned to Data Intensive Cyberinfrastructure Foundation
# This script is a template which must be updated if one wants to use the universal MSS driver.
# Your working version should be in this directory server/bin/cmd/univMSSInterface.sh.
# Functions to modify: syncToArch, stageToCache, mkdir, chmod, rm, stat
# These functions need one or two input parameters which should be named $1 and $2.