Skip to content

Instantly share code, notes, and snippets.

@pmav99
pmav99 / gatttool-polar-h10.txt
Created November 24, 2020 20:32 — forked from fphammerle/gatttool-polar-h10.txt
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
@pmav99
pmav99 / test_single_gpu.py
Created August 8, 2019 13:28 — forked from j-min/test_single_gpu.py
TensorFlow single GPU example
from __future__ import print_function
'''
Basic Multi GPU computation example using TensorFlow library.
Author: Aymeric Damien
Project: https://github.com/aymericdamien/TensorFlow-Examples/
'''
'''
This tutorial requires your machine to have 1 GPU
"/cpu:0": The CPU of your machine.
@pmav99
pmav99 / geo_interface.rst
Last active March 8, 2019 00:32 — forked from sgillies/geo_interface.rst
A Python Protocol for Geospatial Data

Author: Sean Gillies Version: 1.0

Abstract

This document describes a GeoJSON-like protocol for geo-spatial (GIS) vector data.

Introduction

@pmav99
pmav99 / popen.md
Created January 29, 2019 23:27 — forked from achillesrasquinha/popen.md
A Python Popen that does not suck.

A Python Popen that does not suck.

Function

import os
import subprocess

def popen(*args, **kwargs):
    output      = kwargs.get('output', False)
    directory   = kwargs.get('dir')
@pmav99
pmav99 / split_keyboards.md
Created November 3, 2018 11:38 — forked from itod/split_keyboards.md
Every "split" mechanical keyboard currently being sold that I know of
@pmav99
pmav99 / Scala.For.The.Impatient.md
Created October 19, 2018 10:03 — forked from hhimanshu/ Scala.For.The.Impatient.md
Scala for the Impatient Exercises

This gist will contain all the exercises from the book

@pmav99
pmav99 / skylake-tuning-linux.md
Created September 28, 2018 13:25 — forked from Brainiarc7/skylake-tuning-linux.md
This gist will show you how to tune your Intel-based Skylake, Kabylake and beyond Integrated Graphics Core for performance and reliability through GuC and HuC firmware usage on Linux.

Tuning Intel Skylake and beyond for optimal performance and feature level support on Linux:

Note that on Skylake, Kabylake (and the now cancelled "Broxton") SKUs, functionality such as power saving, GPU scheduling and HDMI audio have been moved onto binary-only firmware, and as such, the GuC and the HuC blobs must be loaded at run-time to access this functionality.

Enabling GuC and HuC on Skylake and above requires a few extra parameters be passed to the kernel before boot.

Instructions provided for both Fedora and Ubuntu (including Debian):

Note that the firmware for these GPUs is often packaged by your distributor, and as such, you can confirm the firmware blob's availability by running:

#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@pmav99
pmav99 / balance.py
Created March 2, 2018 17:05 — forked from bbengfort/balance.py
Database transactions blog post.
#!/usr/bin/env python3
import os
import logging
import psycopg2 as pg
from decimal import Decimal
from functools import wraps
from psycopg2.pool import ThreadedConnectionPool
@pmav99
pmav99 / vtk-unstructuredgrid-to-stl.py
Created February 26, 2018 11:57 — forked from thewtex/vtk-unstructuredgrid-to-stl.py
Convert a .vtk UnstructuredGrid file to .stl file.
#!/usr/bin/env python
"""Convert UnstructuredGrid in .vtk files to STL files."""
import sys
import vtk
if len(sys.argv) < 2 or sys.argv[1] == '-h' or sys.argv[1] == '--help':
print('Usage: vtk-unstructuredgrid-to-stl.py <input.vtk> <output.stl>')
sys.exit(1)