Skip to content

Instantly share code, notes, and snippets.

View claunia's full-sized avatar
💭
Fighting for mental health.

Nat Portillo claunia

💭
Fighting for mental health.
View GitHub Profile
@claunia
claunia / .update_git_mirrors.sh
Last active March 2, 2025 15:41
Clone (from a hidden list) and update (from existing) a tree of git mirrors
#!/bin/bash
GIT_TERMINAL_PROMPT=0 find . -type f -iname .list.txt | parallel 'a={}; cd ${a%.list.txt}; parallel --results "`pwd`/results/" --color-failed --env GIT_TERMINAL_PROMPT --timeout 300 git clone --recursive < .list.txt'
GIT_TERMINAL_PROMPT=0 find . -type d -iname .git | parallel --results "`pwd`/results/" --color-failed --env GIT_TERMINAL_PROMPT --timeout 300 'cd {}/..; git pull --recurse-submodules'
@claunia
claunia / convert_png_to_jxl.sh
Created January 12, 2025 14:07
Losslessly convert all PNGs in current folder to JPEG-XL preserving EXIF and mtime. (Bash script)
#!/bin/bash
if [[ -n $(shopt -s nullglob; echo *.png) ]]; then
for i in *.png
do k="${i%.png}.jxl"
cjxl -q 100 -e 10 "$i" "$k"
done
if [[ -n $(shopt -s nullglob; echo *.jxl) ]]; then
for k in *.jxl
do i="${k%.jxl}.png"
@claunia
claunia / convert_jpg_to_jxl.sh
Last active March 6, 2025 20:54
Losslessly convert all JPGs in current folder to JPEG-XL preserving EXIF and mtime. (Bash script)
#!/bin/bash
# Check files with `jpg` extension
if [[ -n $(shopt -s nullglob; echo *.jpg) ]]; then
# Create a directory to work in
mkdir -p wrk
# Move all files with `jpg` extension, as well as XMP sidecars to the working directory
mv ./*.jpg wrk
if [[ -n $(shopt -s nullglob; echo *.jpg.xmp) ]]; then
mv ./*.jpg.xmp wrk