Skip to content

Instantly share code, notes, and snippets.

@claudius108
claudius108 / xmlint.md
Last active September 14, 2024 08:55
xmlint commands

check if xml files are well formed

find ./ -name "*.xml" -exec xmllint --noout {} \;

format files in place

find . -name "*.xml" -type f -exec xmllint --encode utf8 --output '{}' --format --noblanks '{}' \;

validate files against a local schema

find . -name "*.xml" -type f -exec xmllint --noout --nowarning --schema ./modules/validation/tei_all.xsd '{}' \; 2>output.txt

@claudius108
claudius108 / linearize-pdf-with-gs.sh
Created December 20, 2022 13:15
Linearize PDF file with GhostScript
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
@claudius108
claudius108 / firefox.md
Created January 12, 2023 06:45
Varia about Firefox

Download PDF-s for viewing in tmp folder

browser.download.start_downloads_in_tmp_dir

@claudius108
claudius108 / git.md
Last active September 29, 2023 14:08
GIT

Filter out from the Git history all the deleted files

git log --diff-filter=D --summary > deleted-files.txt

Checkout a file that was deleted with a certain commit

git checkout <commit-id>~1 <file/path>

Get the subjects and bodies for all the commits

git --no-pager log --stat --format="===%n%s%-b" | sed '/^$/d' &gt; ../commits-log.txt