Code snippets
Stop all docker containers
docker stop $(docker ps -a -q)
MacOS Install all software updates
Lists and install all pending software updates on MacOS using terminal.
softwareupdate -i -a
SSH download from linux remote to local
The -avzp flags are to be progressive, zipped, recursive.
rsync -avzp destination local
// example downloading file called .salam
rsync -avzP root@host:/home/ec2-user/.salam ./Desktop
Cleanup local git branches
Delete all git branches in local machine except "main" and "staging". More branches can be excluded with the regex pattern
git branch | egrep -v "(^\*|main|staging)" | xargs git branch -D