TICK stack

I’ve been using the TelegrafInfluxDBChronograf-Kapacitor stack for a couple of months at home and at work, for monitoring the state of devices, process and home automation.

We actually I’ve been using theĀ Telegraf-InfluxDB-Grafana stack – I have no idea why they decided to create Chronograf as a fork of Grafana, but it really is pretty rubbish in comparison.

That said, overall the solution is brilliant – Telegraf is pretty good at grabbing stats from your servers, and is highly configurable (at least on Linux – the Windows version could do with some work). The only area that really lets it down is the inability to sum up stats when monitoring processes, so anything that spawns child processes tends to make a mess of the stats.

Influx is very easy to use – the line protocol mechanism for adding data with a simple web request makes it very accessible, with a simple bash script and some sed reformatting able to create a data dump very easily. It seems pretty disk intensive, but I guess that’s always going to be the case with something writing datapoints every minute. Getting used to a timeseries database takes a bit of patience, with pretty limited options for querying, but it’s worth it for the performance and space saving. The only significant lack here is handling of offsets – it’s a very clear use-case to compare timeseries from two equivalent points in time, and surprising it isn’t supported.

Then Grafana tops it off with flexible and powerful visualisation.

I’d recommended anyone who is looking after any sort of IT system to have a play around with it.

Microsoft Spam !

You wouldn’t expect MS to send spam? No, neither would I – surely no major tech company is that dumb?

Well, they seem to have lost the plot on their Surface and OneNote emails.

Register your new Surface and you get a series of “helpful” emails telling you how to use it. Hmm, I don’t need this crap, if I want to know something I’ll Google it (yeah, not Bing!) – where’s the unsubscribe button?

OMG – no unsubscribe!

Must be something in my MS account – but no, it’s all set to the correct “don’t send me crap” settings. The not-well-known Profile Center also looks clean.

Grrr.

And then, I get an email from OneNote.

“Notebooks are social. So pass it on.” “Forward this email to family and friends so they can join the party!”

Ah, no. My notebook is absolutely not f*****g social, it’s my notebook, if I wanted it to be social I would have said so but the default setting should be as private as possible.

Microsoft, get a grip – I’m pretty sure most people who buy a Surface are not aiming to turn it into a social hub, and are quite happy to read the documentation in their own good time without being spammed.

Big Stumble by StumbleUpon

One year ago:

“Our badge/widget isn’t compatible with https sites; there are no plans at this time to change it.”

https://getsatisfaction.com/stumbleupon_help_center/topics/badge_widget_https_mixed_content_problem

Wow, how to ignore an ever growing set of your content base, specifically those most up-to-date and therefore probably interesting, in one sweeping statement.

Must be trying to compete with Reddit for the foot shooting prize.

Cute File Browser

I found this very neat jQuery based file browser:

http://tutorialzine.com/2014/09/cute-file-browser-jquery-ajax-php/

This uses a simply PHP script to form JSON output defining the filesystem, however in my case I want to serve files on a Windows PC using just static content. This is relatively easy to code – we just need to create the file listing in advance, e.g. into something called files.json, and modify the javascript to retrieve this instead of scan.php.

My batch script to do that is listed here – it simply scans recursively from the current directory creating the necessary JSON on the output; you can pipe it to the appropriate location for the files.json output.

@echo off
setlocal enableextensions disabledelayedexpansion

set p=%1
set n=%2
set comma=
set oldcomma=X

call:funcdo "%1" "%2"

endlocal
goto:eof

:funcdo
setlocal
set "p=%~1"
set "n=%~2"

echo {"name":"%n%","type":"folder","path":"%p%","items":[

set oldcomma=%oldcomma%%comma%
set comma=N

for /d %%d in (*) do (
    cd "%%d"
    call:funcdo "%p%/%%d" "%%d"
    echo ,
    cd ..
)

for /f "tokens=*" %%f in ('dir /b *.divx *.mpg *.mpeg *.avi *.mkv *.mp4 *.wmv 2^>nul ^| sort') do (
    echo {"name":"%%f","type":"file","path":"%p%/%%f","size":"%%~zf"},
)

echo {}]}

set comma=%oldcomma:~-1%
set oldcomma=%oldcomma:~0,-1%
endlocal
goto:eof

It’s not very polished and could no doubt be improved, but it works.