update git history
This commit is contained in:
2
aliases
2
aliases
@@ -18,7 +18,7 @@ alias tn="tmux new-session -s"
|
||||
alias gcc="gcc -g"
|
||||
alias hora='date "+%H:%M:%S"'
|
||||
alias wthr='curl wttr.in/san_luis_obispo'
|
||||
alias nf='cl; neofetch; shownetinfo && lab && batt'
|
||||
alias nf='cl; neofetch; shownetinfo && batt'
|
||||
alias servers='python3 /Users/smparkin/Development/server_stats/servers.py'
|
||||
|
||||
# School
|
||||
|
||||
31
functions
31
functions
@@ -1,25 +1,28 @@
|
||||
function shownetinfo() {
|
||||
OSTYPE=$(uname -s)
|
||||
IP=""
|
||||
GW=""
|
||||
NET=""
|
||||
LANIP=""
|
||||
WANIP=""
|
||||
ROUTR=""
|
||||
|
||||
if [ "$OSTYPE" = "Linux" ]; then
|
||||
IP=$(ip addr show | grep -v "127.0.0.1" | grep "inet " | head -1 | cut -d " " -f6 | cut -d "/" -f1)
|
||||
NET=$(ip route | grep default | cut -d " " -f3)
|
||||
elif [ "$OSTYPE" = "Darwin" ]; then
|
||||
NET=$(system_profiler SPNetworkDataType | grep "Router:" | cut -c 19-30 | head -1)
|
||||
IP=$(ifconfig | grep -v "127.0.0.1" | grep "inet " | head -1 | cut -d " " -f2)
|
||||
LANIP=$(ip addr show | grep -v "127.0.0.1" | grep "inet " | head -1 | cut -d " " -f6 | cut -d "/" -f1)
|
||||
ROUTR=$(ip route | grep default | cut -d " " -f3)
|
||||
if [ "$ROUTR" != "" ]; then
|
||||
WANIP=$(timeout 0.25s curl -s ipv4.icanhazip.com)
|
||||
fi
|
||||
elif [ "$OSTYPE" = "Darwin" ]; then
|
||||
ROUTR=$(system_profiler SPNetworkDataType | grep "Router:" | cut -c 19-30 | head -1)
|
||||
LANIP=$(ifconfig | grep -v "127.0.0.1" | grep "inet " | head -1 | cut -d " " -f2)
|
||||
if [ "$ROUTR" != "" ]; then
|
||||
WANIP=$(gtimeout 0.25s curl -s ipv4.icanhazip.com)
|
||||
fi
|
||||
if [ "$NET" != "" ]; then
|
||||
GW=$(curl -s icanhazip.com)
|
||||
fi
|
||||
tput setaf 7; tput bold; echo -en "Net: "
|
||||
tput sgr0
|
||||
tput setaf 7; echo -en "internal $IP"
|
||||
if [ "$NET" != "" ]; then
|
||||
echo -en ", external $GW"
|
||||
echo -en ", router $NET"
|
||||
tput setaf 7; echo -en "internal $LANIP"
|
||||
if [ "$ROUTR" != "" ]; then
|
||||
echo -en ", external $WANIP"
|
||||
echo -en ", router $ROUTR"
|
||||
fi
|
||||
tput sgr0
|
||||
}
|
||||
|
||||
@@ -8,3 +8,5 @@
|
||||
email = smparkin@calpoly.edu
|
||||
[core]
|
||||
excludesfile = ~/.gitignore_global
|
||||
[pull]
|
||||
rebase = false
|
||||
|
||||
2
zshrc
2
zshrc
@@ -45,7 +45,9 @@ if [ "$OSTYPE" = "Darwin" ]; then
|
||||
if [ "$ARCH" = "arm64" ]; then
|
||||
export PATH="/opt/homebrew/bin:$PATH"
|
||||
export PATH="/opt/homebrew/sbin:$PATH"
|
||||
export PATH="/Users/smparkin/Library/Python/3.9/bin:$PATH"
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
export PATH="/usr/local/bin:$PATH"
|
||||
export PATH="/usr/local/sbin:$PATH"
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user