Skip to content

Instantly share code, notes, and snippets.

View whatnick's full-sized avatar

Tisham Dhar whatnick

View GitHub Profile
@whatnick
whatnick / pydrive-dance.py
Created June 13, 2019 12:53
Integration between PyDrive and Flask-Dance
oauth_token = session['google_oauth_token']
from oauth2client.client import OAuth2Credentials
from datetime import datetime
expirty_str = str(datetime.fromtimestamp(oauth_token['expires_at']))
with flask_app.app_context():
token_data = {
'access_token' : oauth_token['access_token'],
'token_expiry' : expirty_str,
'user_agent' : 'PyDrive Automation',
'refresh_token' : None,
@whatnick
whatnick / RealPowerMeter_NoWifi
Last active December 29, 2022 12:52
Real Power Measurement over Serial port for classice through-hole ADS1115 + NodeMCU Energy Monitor
/*
* This sketch sends ads1115 current sensor data via out over serial port.
* It needs the following libraries to work (besides the esp8266 standard libraries supplied with the IDE):
*
* - https://github.com/adafruit/Adafruit_ADS1X15
* - https://github.com/adafruit/Adafruit_SSD1306
* - https://github.com/adafruit/Adafruit-GFX-Library
*
* The above libraries can be directly installed via the Arduino IDE
*
@whatnick
whatnick / Energy_Monitor_Real.ino
Last active October 1, 2022 20:10
ESP8266 Energy Monitor Real Power
/*
* This sketch sends ads1115 current sensor data via HTTP POST request to thingspeak server.
* It needs the following libraries to work (besides the esp8266 standard libraries supplied with the IDE):
*
* - https://github.com/adafruit/Adafruit_ADS1X15
*
* designed to run directly on esp8266-01 module, to where it can be uploaded using this marvelous piece of software:
*
* https://github.com/esp8266/Arduino
*
@whatnick
whatnick / Energy_Monitor.ino
Created September 3, 2015 13:08
ESP8266 Energy Monitor
/*
* This sketch sends ads1115 current sensor data via HTTP POST request to thingspeak server.
* It needs the following libraries to work (besides the esp8266 standard libraries supplied with the IDE):
*
* - https://github.com/adafruit/Adafruit_ADS1X15
*
* designed to run directly on esp8266-01 module, to where it can be uploaded using this marvelous piece of software:
*
* https://github.com/esp8266/Arduino
*
@whatnick
whatnick / deployed_nodes.yaml
Created July 27, 2021 00:11
First cut of KubeSpray Kubernetes cluster on old-laptops
apiVersion: v1
items:
- apiVersion: v1
kind: Node
metadata:
annotations:
kubeadm.alpha.kubernetes.io/cri-socket: /var/run/dockershim.sock
node.alpha.kubernetes.io/ttl: "0"
projectcalico.org/IPv4Address: 192.168.1.21/24
projectcalico.org/IPv4IPIPTunnelAddr: 10.233.90.0
@whatnick
whatnick / usepods.json
Created June 3, 2021 03:12
JupyerHub Userpods
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@whatnick
whatnick / Explore_ECMWF.ipynb
Created May 29, 2021 08:51
Sample GRIB Data Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@whatnick
whatnick / dependencies.svg
Last active February 26, 2021 11:05
Dependency Tree Graph of Sandbox
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@whatnick
whatnick / sandbox.txt
Created February 23, 2021 06:04
Sandbox packages
absl-py==0.11.0
access==1.1.1
affine==2.3.0
aiobotocore==1.1.2
aiohttp==3.7.2
aioitertools==0.7.0
alabaster==0.7.12
alembic==1.4.3
appdirs==1.4.4
argon2-cffi==20.1.0
@whatnick
whatnick / gist:04ecd70f52cc7831a9cb0d0dc16dbfec
Created December 11, 2020 23:26
Update MCP39F511 Datasheet Updates
I have developed and open-source hardware breakout for the MCP39F511 Energy Monitor ASIC. The KiCAD design files are here. During board bringup I have encountered a couple of issues and I believe the datasheet should be updated to highlight these details and make life easier for future engineers.
1) The MCLR pin is attached to the embedded PIC microcontroller and needs to be pulled high on power up, requires a pull-up resistor <=10k .
2) There are 2 versions of this ASIC with default baud rates of 9600 and 115200 respectively. They are pin compatible, however hard to tell apart on sites such as Digikey / Mouser.