Skip to content

Instantly share code, notes, and snippets.

View glumia's full-sized avatar

Giuseppe Lumia glumia

View GitHub Profile
@glumia
glumia / server.go
Created September 28, 2023 17:44
Dummy server to test out http clients.
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
)

Keybase proof

I hereby claim:

  • I am glumia on github.
  • I am glumia (https://keybase.io/glumia) on keybase.
  • I have a public key ASB2zVaNgOzUe-RH-7xKOUSyx0qpcfshZVWSID9p0bMh8go

To claim this, I am signing this object:

@glumia
glumia / durata.sh
Created June 27, 2019 11:27
Calcola la durata dei file (audio/video) passati come argomento
#!/bin/bash
# Calcolata la durata totale dei file audio/video passati come argomento
sum=0
for file in "$@"; do
val=($(ffprobe -i $file 2>&1 | grep -o -E "[0-9]+:[0-9]+:[0-9]+" | tr ":" " "))
sum=$(( sum + 10#${val[0]}*60*60 + 10#${val[1]}*60 + 10#${val[1]}))
done