Skip to content

Instantly share code, notes, and snippets.

@adsr303
Last active March 31, 2017 17:56
Show Gist options
  • Save adsr303/5146708 to your computer and use it in GitHub Desktop.
Save adsr303/5146708 to your computer and use it in GitHub Desktop.
# Extract full-size previews from Nikon raw files
# Replace '-w' with '-w!' to overwrite existing files
exiftool -JpgFromRaw -b -w %d%f.JPG -ext NEF -r directory-or-files
# Copy all tags from raw to JPEG files (best used after above)
# Use the '-overwrite_original' option to skip backup files
exiftool -tagsfromfile %d%f.NEF -ext JPG -r directory-or-files
# Both operations in one command
# -w without format codes is treated as extension
exiftool -b -jpgfromraw -w JPG -execute -tagsfromfile @ -srcfile %d%f.JPG -overwrite_original -common_args -ext NEF directory-or-files
# Resize large photos
for f in *.JPG; do convert "$f" -resize 50% -sharpen 0x1 -quality 92 small/"$f"; done
# Convert a PostScript document to PDF adding margins
# If density is 600 dpi then border of 200 is 1/3 inch
convert -density 600 a.ps -bordercolor white -border 200 -gravity center a.pdf
# Build tags only for C/C++, including headers, don't follow symlinks
ctags -R --extra=+qf --links=no --languages=c,c++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment