Added 'fix' tool and -based network connection monitoring tool
This commit is contained in:
parent
fdd8b21c2c
commit
80db5479a4
29
zsh/utility
29
zsh/utility
@ -16,6 +16,35 @@ function notes() { NOTE="$NOTE_PATH/$1$NOTE_EXTENSION"; [ $1 ] && [ -f $NOTE ] &
|
|||||||
# --- GIT -----------------------------------------------------
|
# --- GIT -----------------------------------------------------
|
||||||
alias gitbranchcleanup='git branch -d $(git branch | sed -E "/develop|master|\*/d")'
|
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 pd='pushd';
|
||||||
alias qd='popd';
|
alias qd='popd';
|
||||||
|
Loading…
Reference in New Issue
Block a user