Last active
          September 17, 2025 08:29 
        
      - 
      
 - 
        
Save andrashann/84abf091c97cd25799b0d49e81460ea5 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
andrashann revised this gist
Sep 17, 2025 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -60,13 +60,16 @@ ffmpeg -i input.mp4 -ss 00:29:21 -t 00:02:26 -async 1 -c copy output.mp4 ffmpeg -i input.mov -c:v libx264 -c:a aac -strict experimental output.mp4 # YOUTUBE-DL (n.b. yt-dlp is a better fork) # Download with subtitles yt-dlp url -o output.mp4 --write-sub # Download audio only from yt-dlp -f 'bestaudio[ext=m4a]' 'http://youtu.be/videoid' # Use cookies from browser (e.g. to be logged in) yt-dlp "http://youtu.be/videoid" --cookies-from-browser Chrome # GHOSTSCRIPT  - 
        
andrashann revised this gist
Feb 16, 2024 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -93,6 +93,14 @@ for file in *.mp3; do mp3info -p "%S\n" "$file"; done | paste -sd+ - | sed 's+\( for file in *.mp3; do mp3info -p "%S\n" "$file"; done | paste -sd+ - | bc | dc -e '?1~r60~r60~r[[0]P]szn[:]ndZ2>zn[:]ndZ2>zn[[.]n]sad0=ap' # FLUIDSYNTH # Convert a folder of midis to wav using a soundfont for filename in ./*.mid; do fluidsynth -F "$(basename "$filename" .mid).wav" soundfont.sf2 "$filename" done # ZIP # remove mac-related files from zip archives  - 
        
andrashann revised this gist
Jan 11, 2023 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,9 +44,10 @@ exiftool "-createdate<filename" "-datetimeoriginal<filename" -overwrite_original # Shift all timestamps of pictures exiftool -AllDates-=1:10 -filemodifydate-=1:10 -P -overwrite_original *.jpg # Retrieve original file number (e.g. IMG_007.jpg from the FileNumber exif field and use as filename exiftool '-filename<$FileNumber.%e' *.jpg # FFMPEG # Combine image files as video  - 
        
andrashann revised this gist
Jan 11, 2023 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,6 +18,11 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. # RENAME # Replace a string in all file names in a folder rename 's/old/new/' * # EXIFTOOL @@ -36,6 +41,11 @@ exiftool '-DateTimeOriginal>FileModifyDate' foo.jpg # Modify EXIF creation date to match filename for files in this folder exiftool "-createdate<filename" "-datetimeoriginal<filename" -overwrite_original_in_place ./ # Shift all timestamps of pictures exiftool -AllDates-=1:10 -filemodifydate-=1:10 -P -overwrite_original *.jpg # Get back original file number (e.g. IMG_007.jpg from the FileNumber exif field and use as filename exiftool '-filename<$FileNumber.%e' *.jpg # FFMPEG  - 
        
andrashann revised this gist
Dec 30, 2021 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -80,3 +80,9 @@ mp3info -p "%f: %m:%02s\n" *.mp3 for file in *.mp3; do mp3info -p "%S\n" "$file"; done | paste -sd+ - | sed 's+\(.*\)+(\1)/60+' | bc # in hh:mm:ss format (https://stackoverflow.com/a/54541337) for file in *.mp3; do mp3info -p "%S\n" "$file"; done | paste -sd+ - | bc | dc -e '?1~r60~r60~r[[0]P]szn[:]ndZ2>zn[:]ndZ2>zn[[.]n]sad0=ap' # ZIP # remove mac-related files from zip archives zip -d filename.zip __MACOSX/\* \*/.DS_Store  - 
        
andrashann revised this gist
Oct 4, 2021 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -77,4 +77,6 @@ mp3info -p "%f: %m:%02s\n" *.mp3 # Print the total length of all mp3 files in a folder (in minutes) # (corrected version of https://superuser.com/a/947201) for file in *.mp3; do mp3info -p "%S\n" "$file"; done | paste -sd+ - | sed 's+\(.*\)+(\1)/60+' | bc # in hh:mm:ss format (https://stackoverflow.com/a/54541337) for file in *.mp3; do mp3info -p "%S\n" "$file"; done | paste -sd+ - | bc | dc -e '?1~r60~r60~r[[0]P]szn[:]ndZ2>zn[:]ndZ2>zn[[.]n]sad0=ap'  - 
        
andrashann revised this gist
Oct 4, 2021 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -74,3 +74,7 @@ java -jar mkgmap.jar --gmapsupp a.img b.img c.img typ.TYP # Print mp3 file names with track lengths of files in current folder mp3info -p "%f: %m:%02s\n" *.mp3 # Print the total length of all mp3 files in a folder (in minutes) # (corrected version of https://superuser.com/a/947201) for file in *.mp3; do mp3info -p "%S\n" "$file"; done | paste -sd+ - | sed 's+\(.*\)+(\1)/60+' | bc  - 
        
andrashann revised this gist
Oct 7, 2020 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,6 +36,7 @@ exiftool '-DateTimeOriginal>FileModifyDate' foo.jpg # Modify EXIF creation date to match filename for files in this folder exiftool "-createdate<filename" "-datetimeoriginal<filename" -overwrite_original_in_place ./ # FFMPEG # Combine image files as video @@ -62,7 +63,14 @@ youtube-dl -f 'bestaudio[ext=m4a]' 'http://youtu.be/videoid' # Convert all text to curves in PDF gs -o file-with-outlines.pdf -dNoOutputFonts -sDEVICE=pdfwrite input-file.pdf # MKGMAP # Combine multiple img files into one java -jar mkgmap.jar --gmapsupp a.img b.img c.img typ.TYP # MP3INFO # Print mp3 file names with track lengths of files in current folder mp3info -p "%f: %m:%02s\n" *.mp3  - 
        
andrashann revised this gist
Jun 10, 2020 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -60,4 +60,9 @@ youtube-dl -f 'bestaudio[ext=m4a]' 'http://youtu.be/videoid' # GHOSTSCRIPT # Convert all text to curves in PDF gs -o file-with-outlines.pdf -dNoOutputFonts -sDEVICE=pdfwrite input-file.pdf # MKGMAP # Combine multiple img files into one java -jar mkgmap.jar --gmapsupp a.img b.img c.img typ.TYP  - 
        
andrashann revised this gist
May 12, 2020 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,6 +33,8 @@ exiftool -all= foo.jpg # Modify file modification/creation date to match EXIF data exiftool '-DateTimeOriginal>FileModifyDate' foo.jpg # Modify EXIF creation date to match filename for files in this folder exiftool "-createdate<filename" "-datetimeoriginal<filename" -overwrite_original_in_place ./ # FFMPEG  - 
        
andrashann revised this gist
May 12, 2020 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,6 +42,9 @@ cat *.jpg | ffmpeg -f image2pipe -r 24 -vcodec mjpeg -i - -vcodec libx264 out.mp # Trim video from -ss to length -t ffmpeg -i input.mp4 -ss 00:29:21 -t 00:02:26 -async 1 -c copy output.mp4 # convert .mov from fcpx into much smaller mp4 ffmpeg -i input.mov -c:v libx264 -c:a aac -strict experimental output.mp4 # YOUTUBE-DL  - 
        
andrashann revised this gist
Jan 29, 2020 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,6 +30,9 @@ exiftool -ext jpg -ext mp4 '-filename<CreateDate' -d '%Y-%m-%d %H.%M.%S%%-c.%%e' # Delete all EXIF information exiftool -all= foo.jpg # Modify file modification/creation date to match EXIF data exiftool '-DateTimeOriginal>FileModifyDate' foo.jpg # FFMPEG  - 
        
andrashann revised this gist
Nov 25, 2019 . 1 changed file with 21 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,24 @@ # Copyright 2019 A. H. # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. # EXIFTOOL # Add coordinates to images in folder from gpx file  - 
        
andrashann created this gist
Nov 25, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ # EXIFTOOL # Add coordinates to images in folder from gpx file exiftool -P -overwrite_original -geotag=track.gpx /path/to/images # Name files according to EXIF date and timestamp exiftool -ext jpg -ext mp4 '-filename<CreateDate' -d '%Y-%m-%d %H.%M.%S%%-c.%%e' ../exiftool_test/ # Delete all EXIF information exiftool -all= foo.jpg # FFMPEG # Combine image files as video cat *.jpg | ffmpeg -f image2pipe -r 24 -vcodec mjpeg -i - -vcodec libx264 out.mp4 # Trim video from -ss to length -t ffmpeg -i input.mp4 -ss 00:29:21 -t 00:02:26 -async 1 -c copy output.mp4 # YOUTUBE-DL # Download with subtitles youtube-dl url -o output.mp4 --write-sub # Download audio only from youtube-dl -f 'bestaudio[ext=m4a]' 'http://youtu.be/videoid' # GHOSTSCRIPT # Convert all text to curves in PDF gs -o file-with-outlines.pdf -dNoOutputFonts -sDEVICE=pdfwrite input-file.pdf