Skip to content

Instantly share code, notes, and snippets.

@thomaslorentsen
Last active March 31, 2020 08:35
Show Gist options
  • Save thomaslorentsen/49ae38b5904dd0d0378d778e8ae63535 to your computer and use it in GitHub Desktop.
Save thomaslorentsen/49ae38b5904dd0d0378d778e8ae63535 to your computer and use it in GitHub Desktop.
Shell

Skip all symlinks that are absolute. Good for doing data migrations to another disk in a live system.

rsync -va --safe-links /from/ /to
docker system df
docker system df -v
docker container prune -f --filter "until=24h"
docker image prune -a -f --filter "until=24h"

Get long sha and files modified today

git log --pretty=format:'%H' --name-only --since="1 day" | cat

Pull all repos in a directory

find . -depth 1 -type d -exec git -C {} pull \;

Get all templates

oc get templates --all-namespaces=true

Generate a auth token

oc serviceaccounts new-token jenkins

Add service account

oadm policy add-role-to-user cluster-admin system:serviceaccount:default:jenkins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment