diff --git a/zsh/utility b/zsh/utility index 898f1a9..ab98684 100644 --- a/zsh/utility +++ b/zsh/utility @@ -16,6 +16,35 @@ function notes() { NOTE="$NOTE_PATH/$1$NOTE_EXTENSION"; [ $1 ] && [ -f $NOTE ] & # --- GIT ----------------------------------------------------- alias gitbranchcleanup='git branch -d $(git branch | sed -E "/develop|master|\*/d")' +alias fix='vim $(git diff --name-only | uniq) -p'; + + +alias monitor_connection='MONITOR_GLOBAL_INTERNET_CONNECTION'; + +MONITOR_GLOBAL_INTERNET_CONNECTION() { + local DELIMITER="\n==============================\n"; + local CONNECTION_MONITOR_FILE="$HOME/.local/connection" + + [ ! -f $CONNECTION_MONITOR_FILE ] && touch $CONNECTION_MONITOR_FILE; + + echo "Attempting first connection...."; + + while true; do + ping 8.8.8.8 -c 5 > $CONNECTION_MONITOR_FILE; + clear; + + printf "$DELIMITER\n" | lolcat; + + grep "packet loss" $CONNECTION_MONITOR_FILE | sed 's/^.*, \(.*% packet loss\).*$/\1/' | lolcat; + echo; + + grep 'bytes from' $CONNECTION_MONITOR_FILE | lolcat; + + printf "\n$DELIMITER" | lolcat; + + sleep 30; + done; +} alias pd='pushd'; alias qd='popd';