Skip to content

Instantly share code, notes, and snippets.

View polettix's full-sized avatar
🐫

Flavio Poletti polettix

🐫
View GitHub Profile

Bug in rrdtool?

Consider the RRD database file [prova.rrd][]. It contains two data sources:

  • total, always reporting about 4 M of "something" (kbyte RAM)
  • used, showing an increase from about 200 k to about 2 M over a 10-years period.

There are aggregation at multiple levels, one over the span of 10 years.

The stand-alone graph for used is the following, showing the increase over time:

#!/usr/bin/env perl
use 5.024;
use warnings;
use English qw< -no_match_vars >;
use autodie;
use experimental qw< postderef signatures >;
no warnings qw< experimental::postderef experimental::signatures >;
use File::Basename qw< basename >;
use Data::Dumper; $Data::Dumper::Indent = 1;
use Storable 'dclone';
#!/bin/sh
microk8s.kubectl config view --raw > ~/kube-config
printf %s\\n "alias k9s='k9s --kubeconfig ~/kube-config'" >> ~/.bash_aliases
mkdir -p ~/bin
curl -L https://github.com/derailed/k9s/releases/download/v0.24.1/k9s_Linux_x86_64.tar.gz \
| tar xzO k9s > ~/bin/k9s
chmod +x ~/bin/k9s
printf %s\\n 'now exit your shell and enter again'
@polettix
polettix / ansible-output
Last active May 19, 2017 15:17
ansible output
This file has been truncated, but you can view the full file.
2017-05-19 14:13:27,549 p=781 u=root | Using /kargo/ansible.cfg as config file
2017-05-19 14:13:31,010 p=781 u=root | PLAY [localhost] ************************************************************************************************************************************************
2017-05-19 14:13:31,027 p=781 u=root | TASK [kargo-defaults : Configure defaults] **********************************************************************************************************************
2017-05-19 14:13:31,027 p=781 u=root | Friday 19 May 2017 14:13:31 +0000 (0:00:00.021) 0:00:00.021 ************
2017-05-19 14:13:31,047 p=781 u=root | ok: [localhost] => {
"changed": false,
"msg": "Check roles/kargo-defaults/defaults/main.yml"
}
2017-05-19 14:13:31,049 p=781 u=root | TASK [bastion-ssh-config : set_fact] ****************************************************************************************************************************
2017-05-19 14:13:31,049 p=781 u=root | Friday 19 May 2017 14:13:31 +000

When you set Let's Encrypt up, you will:

  • generate a key on your computer (among other things), which we will call domain.key
  • regularly update a certificate file via Let's Encrypt (most probably using one of the Acme Client Implementations), we will call this file domain.crt

The domain.key file is for your eyes only; you should keep it safe where you run taskd and set server.key to point to it.

@polettix
polettix / README.md
Created September 12, 2016 16:38 — forked from cjrd/README.md
Interactive tool for creating directed graphs using d3.js.

directed-graph-creator

Interactive tool for creating directed graphs, created using d3.js.

Demo: http://bl.ocks.org/cjrd/6863459

Operation:

  • drag/scroll to translate/zoom the graph
#!/usr/bin/env perl
use strict;
use warnings;
use Mojolicious::Lite;
use Data::Dumper;
$Data::Dumper::Indent = 1;
my $uri = 'http://mojolicious.org';
plugin Minion => {SQLite => 'sqlite:test4bug.db'};
@polettix
polettix / gist:4811572938ecd4103fe6
Last active August 29, 2015 14:20
Bug in $req->to_string()?
# This is the sample program I'm using. $res->to_string() is called
# only if the URI is something like /<true-value>, and is not
# called when the URI is /
use Mojolicious::Lite;
hook after_dispatch => sub {
my ($c) = @_;
my $res = $c->res();
$res->to_string() if $c->stash('what');
$res->headers->header(Server => 'AnotherServer');
@polettix
polettix / cfp-en.html
Created May 14, 2012 11:49
Call For Papers IPW 2012
<p>To suggest a talk, please use <a class="reference" href="/ipw2012/newtalk">the web interface</a>. All proposals must be
submitted by <strike>June 20th, 2011</strike> <strong>August 1st, 2011</strong>.</p>
<p>This year's theme for the workshop is <strong>Two Perls</strong>,
which wants to put relevance both on Perl 5 and Perl 6.
The topic is, however, just a loose guideline:
any Perl-related topic will be fine. Some interesting topics
could be:</p>
<ul>
@polettix
polettix / silv-crontab.sh
Created November 21, 2011 11:31
simple crontab shell driver
#!/bin/bash
function die () {
echo "$*" >&2
exit 1
}
basedir=$(dirname "$0")
basedir=$(readlink -f "$basedir")
cd "$basedir" || die "cannot hop into $basedir"