Skip to content

Instantly share code, notes, and snippets.

View fabdrol's full-sized avatar

Fabian Tollenaar fabdrol

View GitHub Profile
@fabdrol
fabdrol / release.sh
Created February 10, 2021 17:30
Build, sync to S3, invalidate CloudFront Cache and push to Git script. To be used as a local script or in a CI environment
#!/bin/bash
CLOUDFRONT_DISTRIBUTION="<CLOUDFRONT DISTRIBUTION>"
S3_BUCKET="<BUCKET NAME>"
VERSION=$(cat package.json | jq '.version' | tr -d '"')
echo "**** [1/5] Building application v${VERSION}"
yarn build
echo "**** [2/5] Syncing build/* to s3://$S3_BUCKET..."
# To install Node v10.x on UDOObuntu (and ubuntu 14.04 LTS, I suppose) I ran into the issue (see below) that libstdc++6 >= 4.9.x was required, but 4.8.x was supplied.
# libstdc++6 is related to the build chain (g++/gcc). I ran the following commands to upgrade libstdc++6.
#
# The error message: `nodejs : Depends: libstdc++6 (>= 4.9) but 4.8.4-2ubuntu1~14.04.4 is to be installed`
#
# btw - USE THIS AT YOUR OWN RISK AND RESPONSIBILITY.
# Get the right repo's
sudo apt-get update && sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt-get update
@fabdrol
fabdrol / dump.json
Last active August 15, 2018 14:01
dump of parsed data (internal structure)
{
"auxBatteryVoltage": {
"name": "auxBatteryVoltage",
"value": 0.005,
"units": "V",
"type": "metric",
"orig": "5"
},
"batteryCurrent": {
"name": "batteryCurrent",
@fabdrol
fabdrol / nmea0183-signalk.js
Created September 20, 2017 10:29
NMEA0183 Provider
/*
* Copyright 2014-2015 Fabian Tollenaar <fabian@starting-point.nl>
*
* 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
* Unless required by applicable law or agreed to in writing, software
@fabdrol
fabdrol / battery.log
Created September 11, 2017 14:46
Battery.log
(1500649620.000000) vcan0 0DF2140D#000A073039746812
(1500649620.000100) vcan0 0DF2120D#400912002100075B
(1500649620.000110) vcan0 0DF2120D#41CD153ADE68B100
(1500649620.000200) vcan0 0DF2190D#00002100B4000063
@fabdrol
fabdrol / engine.log
Created September 11, 2017 14:45
engine.log
(1500649720.000000) vcan0 0DF2000D#00134A0929000000
(1500649720.000100) vcan0 0DF2010D#201A0004D21D7E1D
(1500649720.000110) vcan0 0DF2010D#217F0960010E075B
(1500649720.000120) vcan0 0DF2010D#22CD150929162E00
(1500649720.000130) vcan0 0DF2010D#2300000000194200
@fabdrol
fabdrol / switching.js
Last active July 4, 2017 08:56
Signal K switching [draft] proposal
// This lives in $.vessel.<UUID|MMSI>.electrical
{
// For the sake of simplicity, I'm consider a "fuse" and a "circuit breaker" to be the same (conceptually, not technically)
fuses: {
'3b4aa0a9-d12a-4c50-8082-eebc93ec427d': {
type: 'bosch', // enum: blade, bosch, circuit-breaker, embedded, other?
speed: 'fast', // enum: slow-blow, fast, ultrafast, other?
ratedCurrent: 15, // A
ratedVoltage: 12, // V
state: 'tripped', // enum: tripped, normal
@fabdrol
fabdrol / log-contributors.sh
Created January 15, 2017 20:13
Bash script to get all contributors from a bunch of repositories. The script loops through a folder containing github repositories, run git log and append the output to a file in the rootdirectory.
#!/usr/bin/env bash
for f in */
do
( cd "./${f}"; (echo "${f}" >> ../shortlog.txt); ( git log --pretty="format:%an <%ae>" >> ../shortlog.txt); cd "../"; )
done
@fabdrol
fabdrol / index.md
Last active September 15, 2016 19:30

Signal K Data Model Reference

This document is meant as the human-oriented reference to accompany the actual JSON Schema specification and is produced from the schema files. Any changes to the reference material below should be made to the original schema files.

Description: This holds the key (MMSI or other unique ID) of this vessel, the actual data is in the vessels array.