Programming

Tuesday, May 19, 2026

This pertains to macOS. Other OS’s may differ.

To export a high resolution image of the entire PDF:

# Note: pdftoppm is provided by Poppler
# If Poppler is not installed then first:
# brew install poppler
pdftoppm -png -r 600 input.pdf output

To export the images that are contained in the PDF:

pdfimages -all input.pdf output

Wednesday, June 4, 2025

When you run a script as a systemd service, you have to define its environment variables in the service file, e.g.

# Set your environment variables here
Environment="OJISAN_INCREMENTAL_UPLOAD_API_KEY=YOUR_ACTUAL_API_KEY_VALUE"
Environment="OJISAN_INCREMENTAL_UPLOAD_DB_USER=your_db_user"
Environment="OJISAN_INCREMENTAL_UPLOAD_DB_PW=your_db_password"
Environment="OJISAN_INCREMENTAL_UPLOAD_DB_NAME=your_db_name"
Environment="DB_HOST=your_db_host"