Skip to content

Instantly share code, notes, and snippets.

@rennokki
Last active November 17, 2024 18:19
Show Gist options
  • Save rennokki/6b2e191de8bbff99e4f604527a94ee2c to your computer and use it in GitHub Desktop.
Save rennokki/6b2e191de8bbff99e4f604527a94ee2c to your computer and use it in GitHub Desktop.
cleanup.sh
#!/bin/bash
# Software Update
# https://gist.github.com/cdeath/dcc57de4d0bbc1d4e0cbb9c167d9a662
softwareupdate -i -a --force --agree-to-license
sudo softwareupdate -i -a -R --force --agree-to-license
# Brew
# https://gist.github.com/cdeath/dcc57de4d0bbc1d4e0cbb9c167d9a662
brew upgrade --greedy --force
brew cleanup
rm -rf $(brew --cache)
brew uninstall --zap {cask}
brew leaves
brew deps --tree --installed
brew autoremove
brew doctor
# npm
# https://gist.github.com/cdeath/dcc57de4d0bbc1d4e0cbb9c167d9a662
npm i -g npm
npm update -g
npm cache clean --force
# pnpm
# https://gist.github.com/cdeath/dcc57de4d0bbc1d4e0cbb9c167d9a662
pnpm add -g pnpm
pnpm up --global --latest
pnpm store prune
rm -rf $(pnpm store path)
# yarn
# https://gist.github.com/cdeath/dcc57de4d0bbc1d4e0cbb9c167d9a662
yarn global upgrade
yarn cache clean
# python
# https://gist.github.com/cdeath/dcc57de4d0bbc1d4e0cbb9c167d9a662
pip install -U `pip list --outdated | awk 'NR>2 {print $1}'`
pip-review --local --interactive
pip cache purge
# docker
# https://gist.github.com/cdeath/dcc57de4d0bbc1d4e0cbb9c167d9a662
docker stop $(docker ps -a -q)
docker system prune -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment