git submodules are erroneous

In the name of sheer simplicity, it would be advised to best not use the git submodule utility ! If there is the utmost need to have one directory within the other, then try to have only git repository among them, yeah. Or else, try to separate out the repositories into separate folders, yah ! It may happen that you may not be able to see new changes in the main directory after using submodule for a while....

 May 2, 2024  •   1 min  •   127 words  •   Suyog Garg

Do not ask for Git passphrase on each commit

So that we don’t have to write the passphrase each time we do git commit ! Add this to the bash file : env=~/.ssh/agent.env agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; } agent_start () { (umask 077; ssh-agent >| "$env") . "$env" >| /dev/null ; } agent_load_env # agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2= agent not running agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?...

 March 28, 2024  •   1 min  •   101 words  •   Suyog Garg

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