Download whole website: httrack

When you launch httrack from the termial, it starts a wizard for configuring the mirroring options

November 29, 2023 · Fernando Costa Bertoldi

PDF utilities based on libpoppler

Poppler is a PDF rendering library based on the xpdf-3.0 code base. The package poppler-utils contains pdf utilities based on Poppler. pdfunite: concatenate documents pdfunite file1.pdf file2.pdf out.pdf pdfseparate: page extraction tool extract from sample.pdf pages 3 to 5, generating sample-page-3.pdf, sample-page-4.pdf, sample-page-5.pdf pdfseparate -f 3 -l 5 sample.pdf sample-page-%d.pdf pdftotext: text extraction pdftoppm: convert to image formats pdftoppm -png file.pdf > file.png pdfinfo: document information pdfsig: verify digital signatures

November 9, 2023 · Fernando Costa Bertoldi

Diffing two tables

To diff specific columns of two .csv files, using miller CLI tool and process substitution <() $ colordiff -u <(mlr --icsv --opprint cut -f 'id,avg_sourcing_spread' then format-values -f '%.4lf' then put '$avg_sourcing_spread=round($avg_sourcing_spread*100.0)' service.csv) <(mlr --icsv --opprint cut -f 'id,sourcing_spread' then format-values -f '%.4lf' then put '$sourcing_spread=round($sourcing_spread*10000.0)' superset.csv) We can also use the spreadsheet to diff two tables: highlight the first table select the conditional formatting tool add the rule A1<>Sheet2!A1 In LibreOffice Calc there is a specific tool to compare tables....

August 10, 2022 · Fernando Costa Bertoldi

Diff long lines

TIL: To compare long lines with diff, break each of them in multiple lines https://www.johndcook.com/blog/2021/04/22/moby-diff/ $ diff -u <(fold -s -w 20 temp1.txt) <(fold -s -w 20 temp2.txt)

August 9, 2022 · Fernando Costa Bertoldi

Change locale of man pages

TIL: use the flag -L to read the manpages with a different locale: man -L en_us nmap Alternative: set the LC_ALL env variable as part of the command https://unix.stackexchange.com/a/87763/79225 # LC_ALL is the environment variable that overrides all the other localisation settings # The C locale is a special locale that is meant to be the simplest locale. LC_ALL=C man 2 select

May 12, 2022 · Fernando Costa Bertoldi

Pretty-print tabular output with column

TIL: pipe output of commands that are tabular to the column command to make them more readable

April 6, 2022 · Fernando Costa Bertoldi

Resolve the path os symlinks with readlink

TIL: use the readlink command to resolve symbolic links to executables. Use the -f option to follow the link recursively. # find the path to the youtube-dl script. readlink -f $(which yt-dlp)

April 6, 2022 · Fernando Costa Bertoldi

compgen: bash built-in for auto-completion

# List all commands that you could run: compgen -c # List all aliases compgen -a # Find all command with "fetch" in the name (all *fetch* variants) compgen -c | grep fetch

Fernando Costa Bertoldi

Expand the last argument of previous command with $_

Last monday I learned that $_ in a script expands to the last argument of the previous command

Fernando Costa Bertoldi

File Hierarchy Standard (FHS) locally as a man page

man hier, pretty much it

Fernando Costa Bertoldi