pdf2jpg via terminal

How to convert PDF to JPG/PNG (images) via command line prompts on MacOS zsh terminal. STEP 1 : Install poppler via brew install poppler STEP 2a : If you only wanna convert one file, run, pdftoppm -jpeg -r 300 path-to-input-folder/**/*.pdf path-to-output-folder/* STEP 2b : If you wanna loop through all the files in then execute, for file in path-to-input-folder/**/*; do pdftoppm -jpeg -r 300 $file path-to-output-folder/*; done; See also : https://stackoverflow....

 March 22, 2024  •   1 min  •   71 words  •   Suyog Garg

Customizing Mac Terminal

Update 2025/04/24 Changed to eza instead exa for alias for ls commands with icons, because the exa package is no longer supported. Thus, # map exa commands to normal ls commands alias ll="eza -l -g --icons" alias li="eza --icons" alias lt="eza --tree --icons -a -I '.git|__pycache__|.mypy_cache|.ipynb_checkpoints'" The full ~/.zshrc file now is: # If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation....

 February 3, 2023  •   8 min  •   1555 words  •   Suyog Garg

gitignore file

To ignore all files larger than 100MB: find ./* -size +100M | cat >> .gitignore To ignore all files larger than 100MB but with pathnames not contianing “data” and without repeating already added large file names: find ./*work*/ -not -path **data** -size +100M | sed 's|^\./||g' | cat >> .gitignore; awk '!NF || !seen[$0]++' .gitignore An Example .gitignore file with other useful settings: GNU nano 2.9.3 .gitignore # Blocklist files/folders in same directory as the ....

 January 23, 2023  •   1 min  •   156 words  •   Suyog Garg