Skip to content

Instantly share code, notes, and snippets.

View fsalehpour's full-sized avatar

Faramarz Salehpour fsalehpour

View GitHub Profile
@fsalehpour
fsalehpour / ghostscript-tips.sh
Last active June 13, 2022 19:32
Tips to do things with ghostscripts
# Reduce the size of a PDF file
# https://askubuntu.com/a/256449/112818
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output_reduced.pdf input.pdf
# Convert a PDF to grayscale colour
# https://superuser.com/a/164857/989263
gs \
-sOutputFile=output_gray.pdf \
-sDEVICE=pdfwrite \
-sColorConversionStrategy=Gray \
@fsalehpour
fsalehpour / watermark.bash
Last active April 25, 2024 17:46
Script to add a scrolling watermark and scaling a video in one go using `ffmpeg`
#!/bin/bash
dir=$(pwd)
(cd $1
mkdir -p output
for i in *
do
output="output/$(echo $i | sed 's/\..*$/\.mp4/')"