Skip to content

Instantly share code, notes, and snippets.

@jniemann66
Last active June 4, 2017 04:28
Show Gist options
  • Select an option

  • Save jniemann66/35b7492b974e97e3fd30c968215e7c21 to your computer and use it in GitHub Desktop.

Select an option

Save jniemann66/35b7492b974e97e3fd30c968215e7c21 to your computer and use it in GitHub Desktop.
random snippets of solutions to weird things I needed to do using 'find'
# remove all image files with dimensions in filename (eg ./Williamstown-012v-300x150.jpg)
# (needed when cleaning media collection from wordpress, because it auto-generates multiple image sizes for every uploaded image)
find . -regex .+[0-9]x[0-9].+ -delete
# run spectrogram tool in parallel on batch of sound files. Concurrency set by numThreads
spectrogram_tool="spectrogram"
numThreads=4
find ./outputs -type f ! -name '*.png' ! -name '*.txt' ! -name '*.sd2' ! -name '*.raw' -print0 | xargs -i --null -n 1 -P $numThreads $spectrogram_tool --dyn-range=190 {} 1200 960 {}.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment