Skip to content

Instantly share code, notes, and snippets.

View choicedraught's full-sized avatar

cd choicedraught

View GitHub Profile
@Jiab77
Jiab77 / setup-nut-and-netdata-on-ubuntu.md
Last active July 20, 2024 09:17
In this document, I will explain how to setup nut (Network UPS Tools) on Ubuntu 18.04 and 20.04.

Setup nut and netdata on Ubuntu

In this document, I will explain how to setup nut (Network UPS Tools) on Ubuntu 18.04 and 20.04.

It is basically the next chapter of my previous gist, Upgrade nut on Ubuntu 18.04.

I'll only document USB connected UPS and not the other supported connection modes.

Install required dependencies

@apal21
apal21 / S3 getObject async-await.js
Last active March 20, 2024 19:47
AWS S3 getObject using async/await
const s3 = new AWS.S3(accessparams);
(async () => {
try {
const file = await s3
.getObject({ Bucket: 'BUCKET-NAME', Key: 'path/to/your/file' })
.promise();
console.log(file.Body);
} catch (err) {
console.log(err);
@davidkelley
davidkelley / module.js
Last active January 12, 2021 16:33
AWS Request Signer V4 Javascript for jQuery AJAX
// Allows you to make signed requests by wrapping your original request object
// inside the Signer() function, then simply passing the return value to $.ajax.
//
// @note Depends on the CryptoJS library being present
//
// $.ajax(Signer(credentials, {
// url: 'https://xxxxxx.execute-api.us-east-1.amazonaws.com/v1/private',
// type: 'POST',
// context: this,
// dataType: 'json',
@katemonkeys
katemonkeys / gist:e17580777b57915f5068
Last active July 16, 2024 16:00
Everything Wrong With The Withings API

Top Six Things You Need To Know About The Withings API*

*where “you” is probably a developer, or at least a strange user

I should preface this by saying that I got a Withings Smart Body Analyzer for Christmas last year and I’ve been generally happy with it. It purports to be able to take my heart rate through my bare feet and that seems not to work for my physiology, but overall I’m a fan. If if their Wikipedia page is to be believed they are having a pretty rad impact on making the Quantified Self movement more for normal people and they only have 20 full time employees. Also they try hard to use SI units, which I can get behind. Anyway, on to the rant.

I originally called this post “Everything wrong with the Withings API” and I meant it. For every useful field I can extract from their “award winning” app, I have spent an hour screaming at the inconsistencies in their implementation or inexplicable holes in their data