Davide Andreazzini

Practical guides on Docker, Makefiles, SSH, Linux, PostgreSQL, Python automation, and self-hosting — written by an Italian developer in Uruguay. No fluff, just working solutions.

Not an Hotdog
AI-ML

Not an Hotdog

I love the silicon valley tv series. and lately I've been doing some machine learning and deep learning studies, so what's the most famous image classification problem of the silicon valley series? Obviously Jin Yang's not an hotdog The following is the Keras model

davide
Backslash and pipe on a US keyboard set as UK
LINUX

Backslash and pipe on a US keyboard set as UK

This is for anyone in the UK, stuck with a US layout keyboard!!! Recently I bought a cheap mechanical keyboard from the US, even though the layout US-UK is fairly similar, some keys are in a different position, like the # and some others are missing (¦|). Today I needed to type

davide
Fast line count
LINUX

Fast line count

The following is a simple bash script used to calculate the number of lines in ginormous text files ( like 20G CSV). #!/bin/bash # get the line count of a file without reading the entire file # accuracy can be adjusted by changing the $linenum parameter path=$1 linenum=$2 head=$(head

davide
DAGs visualization using dagre-3d
JAVASCRIPT

DAGs visualization using dagre-3d

Directed Acyclic Graphs are directed graphs, that have a topological ordering, a sequence of the vertices such that every edge is directed from earlier to later in the sequence. DAGs are often used in ETL processes to define pipelines for ingestion/transform of files and lately as a replacement of

davide
Sleep-sort in javascript
JAVASCRIPT

Sleep-sort in javascript

Sleep sort is a joke sorting algorithm. Sleep sort spawns off one process for each argument. Each process waits for n milliseconds, then prints out n, meaning it takes 1 millisecond to print out "1", 2 millisecond to print out "2", 100 millisecond to print out

davide
Quick and useful Docker commands and configs
DEVOPS

Quick and useful Docker commands and configs

Here is a list of some docker snippets that I use daily. Create a tagged image from Dockerfile docker build -t tag_name /path/to/ Run a docker image in detached mode docker run -p local_port:remote_port -d tag_name Remove stopped containers docker rm $(docker ps -a

davide
Update ssh to version 7.5p1
DEVOPS

Update ssh to version 7.5p1

Follow the instructions to update ssh on the latest version. The process requires patching the current source, which is unfortunately not written anywhere in the open-ssh website. Package Information -Download (HTTP): http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.5p1.tar.gz Download MD5 sum: 652fdc7d8392f112bef11cacf7e69e23 Download size: 1.

davide
Let's encrypt manual mode using DNS record verification
DEVOPS

Let's encrypt manual mode using DNS record verification

Here is the procedure that I've used to create a letsencrypt certificate in manual mode using a DNS record for registration. sudo letsencrypt certonly -d example.com -d www.example.com --manual --preferred-challenges dns The procedure will guide to the creation of a DNS TXT record used to

davide
Removing the hashbang from react-router navigation
JAVASCRIPT

Removing the hashbang from react-router navigation

By default, react-router add the annoying and hated hashbang to the URL, here is how to remove it. import React from 'react'; import ReactDOM from 'react-dom'; import {BrowserRouter, Route, Switch} from 'react-router-dom'; //Container import Full from './containers/Full/' //Views import Login from

davide
ESC
// awaiting input_