You are here

Scripting

Recuperare uno o più siti web dall'Internet Archive Wayback Machine

Translate this article

Premessa

La Wayback Machine è l'interfaccia web utilizzata da Internet Archive per l'estrapolazione dagli archivi dei dati riguardanti siti web. I siti archiviati rappresentano una sorta di "fermi immagine" raccolti al momento dell'acquisizione delle pagine tramite il software di indicizzazione di Internet Archive. Il nome "Wayback Machine" deriva dal termine "WABAC Machine" utilizzato in una delle storie della serie animata Rocky e Bullwinkle. Il servizio, grazie allo spider di Alexa, memorizza nel tempo i cambiamenti e le evoluzioni dei diversi siti web. Per i siti minori non ha un frequente caching, ovvero le pagine vengono memorizzate solo raramente.

Rimuovere la protezione con password da un file pdf (unlock pdf, remove security from pdf)

Translate this article

Ho acquistato un libro, peraltro abbastanza costoso e alto (supera le mille pagine), con in allegato una copia integrale del libro stesso su CD in formato PDF, utile per eventuali ricerche. Perfetto!! Magari tutti gli editori facessero così...

GNU/Linux: load scsi devices (like a scanner) without rebooting

Translate this article

Su GNU/Linux, per usare un dispositivo scsi collegato dopo l'avvio del computer, devo riavviare il computer (operazione non sempre fattibile) oppure, più semplicemente, usare un apposito script, di cui ho trovato documentazione alla pagina: rescan-scsi-bus.sh - rescan the SCSI bus.

Link per download

Codice sorgente dello script

MP4 to DVD-Video in Bash

Translate this article

I sistemi GNU/Linux dispongono di diversi programmini per la creazione di DVD-Video, come DVD-Styler o DeVeDe, ad ogni modo possono esserci situazioni in cui sia preferibile un banalissimo script Bash per convertire un file MP4 (ad esempio un video scaricato da Internet) in un DVD-Video da vedere magari nel lettore DVD di casa.

Lo script seguente (testato su Linux Mint 17), rispetto ai programmi con interfaccia grafica, ha il vantaggio che, nella sua semplicità, permette di individuare eventuali errori o problemi nella creazione del DVD-Video, semplicemente controllando l'output generato.

Normalize an audio file second by second in Bash, with FFmpeg

Translate this article

You usually don't need a script like the following. I just finished writing it. Its use makes sense for old video recordings with considerable volume changes.

The audio is normalized second by second instead of all at once. The script uses a maximum amplification value (35dB) to prevent every silence from becoming a din.

For this script to work, you must have "ffmpeg" and "sox" installed.

Happy hacking!

#!/bin/bash

input=input.mkv
output=output.mp4
audio=audio.wav
newaudio=combined.wav

ffmpeg -i "$input" -vn -ar 44100 -ac 2 "$audio"
ffmpeg -i "$audio" -f segment -segment_time 1 -c copy out%06d.wav
for f in out*.wav
do
    # detects volume in decibel
    MAX=$(ffmpeg -hide_banner -i "$f" -map 0:a -filter:a volumedetect -f null /dev/null 2>&1 | grep 'max_volume' | awk '{print $5}')
    # removes the minus sign (only if $MAX starts with a "-" (wildcard matching))
    if [[ $MAX == -* ]]; then MAX="${MAX:1}"; fi
    # set a maximum volume amplification
    if (( $(echo "$MAX > 35.0" | bc -l) )); then MAX="35.0"; fi
    echo $f" -> "$MAX
    ffmpeg -i $f -af "volume="$MAX"dB" max$f
done

# Before merging the audio files with sox, we need to set up an high max number of files to be concatenated
ulimit -n 16384 # https://www.spinics.net/lists/sox-users/msg00167.html
sox maxout*.wav $newaudio

rm *out*.wav
rm $audio

# now we replace the old audio with the new audio (https://superuser.com/a/1137613)
ffmpeg -i "$input" -i "$newaudio" -c:v copy -map 0:v:0 -map 1:a:0 "$output"
rm $newaudio

TTS gratuito (Text-to-Speech) basato su Web Speech API

Translate this article

Vedi anche: Nuove funzionalità di traduzione e sintesi vocale nel blog

Inserisci un testo nell'input sottostante e premi "Play" per ascoltarlo. Scegli la lingua e la voce usando il menù a tendina.

La qualità della voce può cambiare a seconda del browser e del sistema operativo che stai utilizzando.

1

1

Informativa sulla privacy

Il servizio TTS presente in questa pagina non comporta alcuno scambio di dati con il mio server: la conversione del testo in audio avviene interamente sul dispositivo dell’utente, sfruttando le funzionalità offerte dal browser utilizzato.

Tuttavia, alcuni browser – come Google Chrome e Microsoft Edge su sistemi Linux – effettuano la sintesi vocale inviando il testo ai rispettivi server (Google e Microsoft). In questi casi, eventuali implicazioni relative alla privacy dipendono esclusivamente dal comportamento del browser e dai fornitori dei relativi servizi, e non da questa pagina web. È bene sottolineare che altri browser, o gli stessi browser su sistemi operativi diversi, possono invece eseguire la sintesi vocale in modo completamente offline.

Non raccolgo né elaboro alcun dato relativo agli utenti o all’utilizzo del servizio TTS offerto su questo blog.

 

Doppiare video in locale, senza cloud, offline: autodub_local

Translate this article

Negli ultimi anni sono comparsi molti servizi online che promettono trascrizione, traduzione e doppiaggio automatico dei video. Sono comodi, ma hanno anche alcuni limiti evidenti, a cominciare dai costi ricorrenti.

Dall'esigenza di avere un'alternativa per doppiare video con il mio computer, usando esclusivamente software libero e gratuito che giri sulla mia macchina, è nato autodub_local. L'ho rilasciato pubblicamente su GitHub con licenza CC0, cioè con una rinuncia al copyright assimilabile al pubblico dominio: https://github.com/jsfan3/autodub-local

In pratica è uno script Bash che gira su Linux. Per ogni video MP4, autodub_local estrae l’audio, trascrive il parlato, separa i diversi speaker, traduce il contenuto, genera una nuova voce sintetica per ogni parlante, clonandone il timbro vocale, e infine crea un nuovo MP4 con la traccia audio doppiata, mantenendo intatto il flusso video originale. Si tratta quindi di un doppiaggio automatico pensato per registrazioni come webinar, livestream, interviste, lezioni e riunioni, cioè contenuti in cui il sincronismo perfetto del labiale non è fondamentale.

L'uso di questo script non è solo una questione ideologica di indipendenza da servizi esterni o un modo per evitare abbonamenti: in molti casi è il modo più diretto per mantenere controllo, privacy e prevedibilità del flusso di lavoro.

La prima ragione è infatti la privacy. Se un video contiene conversazioni private, riunioni, lezioni interne o materiale che non si desidera caricare online, l’elaborazione locale è la scelta più naturale. Invece di spedire il contenuto a una piattaforma remota, si lavora direttamente sul proprio sistema.

La seconda ragione è il controllo. Quando si usa una pipeline locale, si possono vedere e conservare i file intermedi: trascrizione, diarizzazione (cioè la distinzione dei parlanti), traduzione, segmenti audio sintetizzati. Questo è importante perché consente di interrompere il processo, correggere a mano una traduzione problematica e poi riprendere il lavoro senza rifare tutto da capo. Nel caso di autodub_local, il supporto a checkpoint e resume è una parte esplicita del progetto.

Di contro, una pipeline locale richiede pazienza, un po’ di spazio su disco e un computer sufficientemente adatto, ma non impone un pagamento per ogni minuto elaborato. Se la GPU del proprio computer è idonea, lo script la usa automaticamente, riducendo drasticamente i tempi; altrimenti ricorre alla CPU.

La terza ragione è la trasparenza tecnica. In un servizio online si vede il risultato finale, ma raramente si ha piena visibilità di cosa sia successo in mezzo. In un progetto open source, invece, si può capire quali componenti sono usati, come sono configurati e dove intervenire se qualcosa va corretto o migliorato.

La qualità del doppiaggio dipende da molti fattori: qualità dell’audio di partenza, chiarezza degli speaker, lingua sorgente, lunghezza dei segmenti, terminologia specialistica, qualità della traduzione automatica e resa della sintesi vocale. Nei contenuti tecnici o medici, per esempio, è possibile che alcune frasi richiedano una revisione manuale della traduzione prima di arrivare a un risultato davvero pubblicabile.

(14 aprile 2026)

Privacy‑Friendly IP Lookup Is Back – Cleaner, Smarter, Still No Trackers

Translate this article

A few years ago I built a simple, privacy‑respecting page that shows your public IP address along with a basic reverse DNS and a whois lookup. It did that without setting any cookies, without third‑party trackers, without ads, and – most importantly – without ever storing your IP address on the server. Then, for a long time, it sat behind a “Not authorized” error and stopped working.

Today I’m happy to announce that the page is back online – and it has been significantly improved:

→ Open the IP & Privacy Check Tool

The tool is meant for anyone who wants a quick, trustworthy way to see which IP address they are exposing to the internet, along with useful privacy tests. It’s still the same zero‑log, zero‑tracker philosophy, but now the whois section is much smarter.

What the page does

  • Shows your current public IP address (IPv4 or IPv6).
  • Performs a reverse DNS lookup.
  • Displays your browser’s user agent (and warns if JavaScript is enabled).
  • Links to external, reputable tests for: third‑party cookies, DNS leaks, WebRTC leaks, browser fingerprinting, and canvas fingerprinting.
  • Provides a whois information block that now shows only the actual assignee of the IP, without the confusing multi‑registry results it used to display.

What changed (and why it matters)

The original code queried up to five different whois servers (AfriNIC, LACNIC, APNIC, ARIN, RIPE). Most of the output was generic delegation data like “this range belongs to APNIC”. That made it hard to spot who really owns the IP.

Now the script:

  • Determines the correct Regional Internet Registry (RIR) for the IP via IANA.
  • Contacts only that RIR, then automatically follows any referral to the final whois server that holds the assignment details.
  • Cleans up comments and empty lines, presenting only the relevant registration information (netname, description, country, abuse contact, etc.).

The rest of the page hasn’t changed: no logs, no cookies, no analytics, no external requests except the third‑party tests you explicitly click on. The code is still simple PHP that you can read and host yourself if you want.

If you find it useful, sharing or linking to it helps others discover a transparent alternative to commercial “check my IP” services that often profile visitors.

(May 6, 2026)

autodub-local 2.0: Local and Cloud-Assisted Video Dubbing

Translate this article

I had already introduced my first version of autodub-local on this blog in this Italian post. That first release was mainly an experiment: a Bash-based workflow to dub videos locally, without depending on cloud services. Version 2 is now ready, and it is a much more complete tool.

The goal is still the same: take a video file, transcribe the speech, translate it, generate a new spoken track in the target language, and mux it back into an MP4 file. It is designed especially for talks, interviews, webinars, lectures, meetings, and long recordings where perfect lip-sync is not the main requirement, but intelligible and reasonably timed dubbing matters.

The new version no longer assumes a default input file or a default language pair. The user must explicitly choose the input file, source language, target language, translation method, and TTS engine. The input can be any format readable by ffmpeg, not only MP4: for example WebM, MKV, MOV, or audio-only files can also be processed.

One of the biggest changes is that autodub-local 2.0 can now be used in two broad modes. The fully local mode uses local models for transcription, diarization, translation, LLM-based text adaptation, and speech generation. This is the privacy-oriented path, but it needs a suitable machine, many gigabytes of disk space, and patience.

There is also a cloud-assisted mode, enabled with --only-cloud, for users who do not have the hardware or disk space needed for a fully local run. In that mode the heavy AI stages can use online services for transcription, diarization, and LLM adaptation, while Microsoft Edge TTS can generate natural-sounding voices without a local GPU. This is not meant to replace the local mode for privacy-sensitive use cases, but it makes the program practical on older computers.

Version 2 also adds better voice handling. It supports multiple TTS engines: XTTS for local voice cloning, Kokoro for local non-cloning voices, and Microsoft Edge TTS for online neural voices. Speakers can be detected automatically, and voices can be mapped explicitly to speakers when the user wants precise control. The script can also list and sample available voices, which makes it easier to choose a voice before running a long dubbing job.

Another important improvement is timing. Translated text often does not fit the original speech window, especially when translating between languages with different sentence length and speaking rhythm. autodub-local 2.0 can use an LLM to shorten or adapt translated lines when they are too long, and it applies only limited time-stretching to avoid damaging the generated voice too much.

The command-line interface has been cleaned up as well. There is now a proper --help screen, a clean command for removing temporary per-video work folders, checkpoint/resume support, explicit CPU-only mode with --no-gpu, and clearer options for ASR, diarization, translation, TTS, speaker count, voice mapping, and LLM adaptation.

The repository includes example dubbed outputs for comparison, generated with both the cloud-assisted workflow and the fully local workflow. On my old, underclocked test machine, the fully local workflow was about 9.5 times slower than the cloud-assisted one on the short test video. That is a reasonable tradeoff: local processing is heavier, but it avoids sending the media content to cloud services.

autodub-local remains free software, released under CC0. The project is available on GitHub: https://github.com/jsfan3/autodub-local.

Version 2 is not a magic dubbing studio. Quality still depends on the original audio, the transcription and diarization quality, the translation backend, the chosen TTS engine, and the timing constraints of the source video. But compared with version 1, it is far more flexible, more automated, and much more usable in real workflows.

(August 6, 2026)