Skip to content

Instantly share code, notes, and snippets.

@cb-v4s
Last active May 23, 2022 10:07
Show Gist options
  • Select an option

  • Save cb-v4s/1a18b209be2690d64878bb128fe11160 to your computer and use it in GitHub Desktop.

Select an option

Save cb-v4s/1a18b209be2690d64878bb128fe11160 to your computer and use it in GitHub Desktop.
misc
; find all the files containing `topsykrettz` str in the current folder excluding `node_modules` dir
grep -iRl "topsykrettz" ./ | grep -v node_modules
; find all `mongodb+srv://` occurences in all git logs
git log|grep commit|cut -d' ' -f2|while read commit; do git show $commit; done| grep -i mongodb+srv://
; monitor logs in realtime
tail -f logfile
; copy file content to clipboard
cat xyz | pbcopy
; store git credentials
git config credential.helper store
git config --global credential.helper 'cache --timeout=3600'
; restore session
fg
; detach tmux session over ssh
tmux detach -P ; from remote connection
ssh -t <user>@<addr> tmux attach ; restore connection
; discard local changes git
git reset --hard
git checkout <filename>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment