Skip to content

Instantly share code, notes, and snippets.

@iaean
iaean / README.md
Last active September 11, 2017 12:01
Illustrate rrdxport(1) data model

Overview

This example tries to illustrate the XML data model of rrdxport(1), part of the [rrdtool][0] suite. Seems it's not well documented yet. We use [XSLT][1] to print the first and last curves of the model as CSV and the [XPath][2] function format-number() to make the default rrdtool output format for numbers more human readable.

Usage

If there is well-formed XML you can run:

xsltproc xport2csv.xsl xport.xml

@iaean
iaean / README.md
Last active August 15, 2017 16:37
Backup ownCloud calendars and addressbooks

A shell stub to backup [ownCloud][0] calendars and addressbooks as ICS or VCF. Maybe it works for [Nextcloud][1] as well.
In order to keep only one cleartext password, an owncloud backup user is used for authorization. All users wishing a backup of their data, have to share their calendars and contacts (read only) to this user and needs to be added to the config file...

oc.ics.vcf.backup

Config

  • Create an user backup within your ownCloud.
@iaean
iaean / README.md
Last active May 30, 2017 09:14
Check DNS resolver reachability for all local IP addresses

A shell stub to check if all configured DNS resolver are reachable from all local IP addresses. It tries to search CNAME or A for an example query by binding the query to all local IPs. Remember: NXDOMAIN is a valid result. It's like a DNS ping...

cknsc.sh [www.example.com]

Config

Set CACHE to the IPs you like to test.

@iaean
iaean / b3.js
Created February 17, 2016 19:44
bluebird .mapSeries() node issue
#!/usr/bin/env node
'use strict';
var Promise = require('bluebird');
console.error(Promise.prototype.mapSeries);
function delayResolve(t) {
return new Promise(function(resolve, reject) {
#!/usr/bin/env node
'use strict';
var Promise = require('bluebird');
function delayResolve(t) {
return new Promise(function(resolve, reject) {
setTimeout(function() { resolve(t); }, t); }); }
@iaean
iaean / README.md
Last active October 16, 2023 03:06
Howto remove undesirable datasets from RRD

Overview

Sometimes arises the wish to delete some broken datasets from RRD files. This is not possible out-of-the-box by design. But there are the rrdtool dump/restore commands. The interchange format is XML. So the idea is to modify the XML before restoring it.

There are two little deficiencies with the XML. It's not documented and some useful information is provided by XML comments instead of be part of the XML itself. This makes XSLT processing difficult.

Here are some XSLT transformations, that are trying to handle the deletion of some datasets and producing