Created
September 20, 2019 11:10
-
-
Save dhondta/1b7fa656c86898b2fe0e9b1b2d2ecfdc to your computer and use it in GitHub Desktop.
Bash RC helper functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Custom git repos update function | |
git-repos-update() { | |
local currdir=$(pwd) | |
for root in /opt ~/.opt; do | |
for D in $root/*; do | |
if [ -d "${D}" ]; then | |
cd "${D}" | |
cat .git/config 2>/dev/null | \ | |
grep url | \ | |
cut -d" " -f 3 && \ | |
git pull -v 2>/dev/null | |
fi | |
done | |
done | |
cd "${currdir}" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip-update | |
pip2-upgrade() { | |
sudo pip2 list --outdated | \ | |
cut -d' ' -f1 | \ | |
egrep -v "^(\-|Package|distro\-info)" | \ | |
xargs -n1 sudo pip2 install -U | |
} | |
pip3-upgrade() { | |
pip3 list --outdated | \ | |
cut -d' ' -f1 | \ | |
egrep -v "^(\-|Package|distro\-info)" | \ | |
xargs -n1 sudo pip3 install -U | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Custom system update function | |
system-update() { | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
sudo apt-get autoremove -y | |
sudo apt-get autoclean | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment