Skip to content

Instantly share code, notes, and snippets.

@renehamburger
renehamburger / check-user-beancounters.js
Last active Apr 4, 2020
Send user_beancounters metrics to CloudRadar
View check-user-beancounters.js
#!/usr/bin/env node
// How to use:
// 1. Create a custom check on CloudRadar called 'beancounters', which should be updated every 5 minutes.
// 2. Insert the custom check token below.
// 3. Execute this script every 5 minutes with root privileges,
// e.g. by calling `sudo crontab -e` and adding `*/5 * * * * /usr/bin/node /<Path to script>/check-user-beancounters.js`
const axios = require('axios').default;
const { exec } = require('child_process');
View slimdown.js
'use strict';
/**
* Javascript version of https://gist.github.com/jbroadway/2836900
*
* Slimdown - A very basic regex-based Markdown parser. Supports the
* following elements (and can be extended via Slimdown::add_rule()):
*
* - Headers
* - Links