Switching from Wordpress to a static website

I migrated my Blog site from Wordpress to a faster static web site using markdown files and Hugo.

July 20, 2020 · 1 min · 18 words · Matteo Redaelli

Doctor Planning resolved with #Prolog

Below my #prolog solution for “Doctor Planning” proposed by dmcommunity.org challenge April 2020 There should be more constraints like a limit of shifts a week for each doctor… In any case after few seconds I get the first result [[2,3,4],[2,3,4],[2,3,4],[2,3,4],[1,2,3],[1,2,4],[1,2,4]] It means: Monday sheets: doctor 2 (early), doctor 3 (late) and doctor 4 (night)… :- use_module(library(clpfd)). /* using swi-prolog */ :- use_module(library(clpz)). /* using scryer-prolog */ /* solver for issue https://dmcommunity....

April 22, 2020 · 4 min · 802 words · Matteo Redaelli

Imperative (not functional) languages are so boring. Long life to logical and declarative programming like Prolog

Below a simple example of using a a declarative language (Prolog) for finding all solutions for a trick game… ?- use_module(library(clpfd)). ?- X in 1..9, Y #= (X * 3 + 3) * 3, Z #= (Y rem 10) + (Y div 10), setof(Z, X^Y^label([X,Y,Z]), Sol). Sol = [9],

April 18, 2020 · 1 min · 49 words · Matteo Redaelli

My Networking Survival Kit

In this small tutorial I’ll speak about tunneling, ssh port forwarding, socks, pac files, Sshuttle I’ve been using Linux since 1995 but I have never been interested a lot in networking. In these many days of smart working (due to Covid-19) I have found some useful tricks to connect to remote systems that are not directly reachable from my lan/vpn Case 1 (port forwarding): I wanted to connect to targethost.redaelli.org at tcp port 10000 but I was not able to reach it directly but only through an other host (tunnelhost....

March 15, 2020 · 2 min · 379 words · Matteo Redaelli

How to backup and restore Glue data catalog

How to recover a wrongly deleted glue table? You should have scheduled a periodic backup of Glue data catalog with aws glue get-tables --database-name mydb > glue-mydb.json And recreate your table with the command aws glue create-table --cli-input-json '{...}' But the json format of aws glue get-tables is quite different from the json format of aws create-table. For the conversion you can use a simple python script like the following one...

February 21, 2020 · 1 min · 106 words · Matteo Redaelli