Skip to content

Instantly share code, notes, and snippets.

@mgranberryto
mgranberryto / calculate.js
Created July 20, 2017 19:48
Exponential IOB curves for OpenAPS
// from: https://stackoverflow.com/a/14873282
function erf(x) {
// save the sign of x
var sign = (x >= 0) ? 1 : -1;
x = Math.abs(x);
// constants
var a1 = 0.254829592;
var a2 = -0.284496736;
/**
* NightscoutPump
*
* Copyright 2017 Matthias Granberry
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@mgranberryto
mgranberryto / edison_low_power.sh
Created February 11, 2017 03:06
Put devices into low power mode for Edison
echo '0' > '/proc/sys/kernel/nmi_watchdog'
echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs'
echo 'auto' > '/sys/bus/pci/devices/0000:00:13.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:00.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:0d.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:0e.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:04.0/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:04.1/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:04.2/power/control'
echo 'auto' > '/sys/bus/pci/devices/0000:00:04.3/power/control'