Skip to content

Instantly share code, notes, and snippets.

View loudestnoise's full-sized avatar

David Cintron loudestnoise

View GitHub Profile
@loudestnoise
loudestnoise / updatenightscout.md
Last active February 18, 2021 22:58
Update Nightscout instructions on Linux (Ubuntu) VPS with PM2

Update Nightscout instructions on Linux (Ubuntu) VPS with PM2

  • run pm2 delete server to stop Nightscout
  • cd into cgm-remote-monitor
  • run git pull
  • run git checkout 14.2.1 (but substitude 14.2.1 with whatever new release tag from here)
  • run rm -r node_modules
  • run npm i
  • run npm run postinstall
  • run env $(cat my.env) pm2 start lib/server/server.js --update-env
@loudestnoise
loudestnoise / gist:8355939da3918ec356ca2e5bf20f6452
Created August 10, 2020 22:45
Export Tidepool Web data to JSON using API
(user @ host): ~
--> curl -v -X POST -u email@domain.com https://api.tidepool.org/auth/login
Enter host password for user 'email@domain.com':
* Trying 34.216.109.25...
* TCP_NODELAY set
* Connected to api.tidepool.org (34.216.109.25) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem

Self Hosted Nightscout Instance

This document describes making a self hosted nightscout instance, with SSL encryption and certificate with Let's Encrypt.

Ubuntu Machine

Set up a Digital Ocean or Linode virtual private server (VPS) using Ubuntu LTS. Dave chose 20.04 at the time of writing (2020-07-10)

Update the Ubuntu instance: sudo apt-get update && sudo apt-get upgrade

pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
@loudestnoise
loudestnoise / nsinstall
Created September 12, 2016 16:25
SRSLYNS
nightscout@nightscout:~/cgm-remote-monitor$ sudo apt-get install -y python-software-properties python g++ make git
Reading package lists... Done
Building dependency tree
Reading state information... Done
python is already the newest version.
git is already the newest version.
The following extra packages will be installed:
binutils g++-4.8 gcc gcc-4.8 libasan0 libatomic1 libc-dev-bin libc6-dev
libgcc-4.8-dev libgomp1 libitm1 libquadmath0 libstdc++-4.8-dev libtsan0
linux-libc-dev manpages-dev
@loudestnoise
loudestnoise / my.env
Created September 11, 2016 21:57
Nightscout my.env
MONGO=mongodb://localhost:27017/nightscout
API_SECRET=PUTACRAZYLONGPASSWORDHERE
THEME=colors
ENABLE=bridge%20iob%20careportal%20basal%20cob%20cage%20sage%20pump
DEVICESTATUS_ADVANCED=true
PUMP_FIELDS=reservoir%20battery
PORT=1337
BRIDGE_USER_NAME=username
BRIDGE_PASSWORD=password
BRIDGE_MAX_COUNT=3
(dcintron @ DCintron-MBP): ~/Loop
⇢ git merge upstream/master
warning: Cannot merge binary files: Carthage/Build/iOS/xDripG5.framework/xDripG5 (HEAD vs. upstream/master)
warning: Cannot merge binary files: Carthage/Build/iOS/xDripG5.framework/Modules/xDripG5.swiftmodule/x86_64.swiftmodule (HEAD vs. upstream/master)
warning: Cannot merge binary files: Carthage/Build/iOS/xDripG5.framework/Modules/xDripG5.swiftmodule/i386.swiftmodule (HEAD vs. upstream/master)
warning: Cannot merge binary files: Carthage/Build/iOS/xDripG5.framework/Modules/xDripG5.swiftmodule/arm64.swiftmodule (HEAD vs. upstream/master)
warning: Cannot merge binary files: Carthage/Build/iOS/xDripG5.framework/Modules/xDripG5.swiftmodule/arm.swiftmodule (HEAD vs. upstream/master)
warning: Cannot merge binary files: Carthage/Build/iOS/SwiftCharts.framework/SwiftCharts (HEAD vs. upstream/master)
warning: Cannot merge binary files: Carthage/Build/iOS/ShareClient.framework/ShareClient (HEAD vs. upstream/master)
warning: Cannot merge binary files: Car
(pi @ raspberrypi): ~/skadoosh
⇢ openaps gather-pump-data
pump://JSON/read_temp_basal/monitor/temp-basal-status.json
reporting monitor/temp-basal-status.json
pump://JSON/reservoir/monitor/reservoir.json
reporting monitor/reservoir.json
pump://JSON/read_status/monitor/status.json
reporting monitor/status.json
pump://JSON/read_battery_status/monitor/battery.json
reporting monitor/battery.json
[
{
"monitor/glucose-raw.json": {
"count": "20",
"device": "Maxim",
"use": "iter_glucose",
"reporter": "JSON"
},
"type": "report",
"name": "monitor/glucose-raw.json"
MONGO_CONNECTION=mongodb://user:pass.mlab.com:36648/mydb
MONOGO_COLLECTION=entries
CUSTOM_TITLE=sitename
THEME=colors
BRIDGE_USER_NAME=myuser
BRIDGE_PASSWORD=mypassword