A collection of simple but useful Bash scripts so I don't have to remember the commands. Most scripts deal with .pdf or video file manipulation/conversion. Some scripts have become less "simple" over time as I add more functionality, but my goal is to make the code easy to understand over making it compact or efficient.
See LICENSE for details.
djvu2pdf.sh- Convert
.djvuto.pdf - Requires
ddjvu
- Convert
pdf2png.sh- Convert
.pdfto a set of.pngs
- Convert
pdf2png2pdf.sh- Convert
.pdfto.pngand then back to.pdf - Useful for stripping hyperlinks and searchable text in PDFs
- Requires
imagemagick
- Convert
pdfcombine.sh- Combine multiple
.pdffiles into a single.pdf - Requires
pdftk
- Combine multiple
avcomb.sh- Combine the audio stream of video 1 with the video stream of video 2
- Requires
ffmpeg
to-webm.sh- Converts a video container file (e.g. .mp4) to .webm format
- Requires
ffmpeg
vid2avi.sh- Convert a compatible video container file to
.aviwhile trying to maintain good quality - Requires
ffmpeg
- Convert a compatible video container file to
2iso.sh- Converts a single file or folder into a
.isofile - Requires
mkisofs
- Converts a single file or folder into a
hashmd.sh- Calculates the checksum/hashes of all the files in a folder and generates a Markdown-style table of the results.
- Requires
libarchive-zip-perl - See an example of the tables generated here
randstr.sh- Get 128 bytes of random data from
/dev/urandomand print visible ASCII characters only - Passing
-amakes only alpha-numeric characters print - Passing
-Amakes only alpha-numeric characters print, excluding O0lI
- Get 128 bytes of random data from
sha256-check.sh--checkif the calculated SHA256 sum of file equals the provided SHA256 sum string- Saves you from making a formatted file with the sum and filename then running
sha256sum --check ... - Usage:
./sha256-check.sh <file> <SHA-256-str>
shredu.sh- Overwrites the specified file(s) with random data, then with all zeros, and then removes the file(s)
- Has option to recursively shred all files in directory:
-r - Uses the
shredcommand
upgrade.sh- Fetch and update packages; then remove old packages
- Uses
apt-getpackage manager