Random Linux tips and tricks
Create subtitled video with album art and high resolution audio
ffmpeg -framerate 1 -loop 1 -i final-cover.png -i album.ogg -acodec copy -vcodec libvpx-vp9 -crf 20 -b:v 0 -vf subtitles=album.ass -shortest album1.webm
This assumes you already have a high resolution opus/ogg file of the album. The album.ass file is the subtitle file, which can be done using gnome-subtitles or something more advanced such as Aegisub. Further details here. I selected the VP9 codec for compatibility and opus/ogg audio for best quality audio and broad compatibility.
Merge, split, and/or Bates stamp PDF files on Linux
Seriously, this is one of the hardest things I have ever done. Finding the right tool was half the challenge.
I am pleased to recommend CPDF, which is free for personal and non-commercial use, but otherwise does require a license (worth it).
Merge is the default operation:
cpdf -merge file1.pdf file2.pdf -o file.pdf
Split into n-page chunks
cpdf -split -chunk 20 file.pdf -o piece%%%.pdf
Unfortunately, neither CPDF nor PDFTK can apparently split a file based on file size of the resulting chunks. This is extremely frustrating when there are file size limitations on certain courts' electronic filing systems. The solution I use is to count the number of pages (
cpdf -pages file.pdf), divide by the file size in megabytes, split the PDF using that number of pages per chunk, then manually combine the resulting chunks until they are just under the file size I want. Frustrating, and begging for automation. I could probably write a script to do that, but it would be nice if there were a tool already out there.
This knowledge took me over a year and a half to obtain. I present it here for free to save others time.
cpdf -add-text "%Bates" -bates 1 file.pdf -bottomright 30 -o stamped.pdf
Change a RHEL 7 system from graphical login to shell login, and then start KDE
localhost$ sudo systemctl enable multi-user.target
localhost$ startx /usr/bin/startkde
You would not believe how long it took me to figure that out. If you just do startx, it will freeze your system if there are any problems with GNOME.
Last updated: February 3, 2019
© Andrew G. Watters