-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_aliases
103 lines (84 loc) · 2.89 KB
/
.bash_aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
eval $(dircolors -b ~/startup/.dircolors)
test -f /etc/profile.d/golang_path.sh && source /etc/profile.d/golang_path.sh
#command -v kubectl.exe && source <(kubectl.exe completion bash)
export PATH=$PATH:$HOME/go/bin
export GOPRIVATE=streem.tech,*.streem.tech
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux
#need to test for if this a unix install or not.
command -v kubectl > /dev/null && source <(kubectl completion bash)
command -v minikube > /dev/null && source <(minikube completion bash)
;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${unameOut}"
esac
#echo ${machine}
#Set Bash Prompt to
#[email protected]; Linux
#¦----Wed Mar 27, 09:06:06
#+-~:
export PS1="\[$(tput bold)\]\[$(tput setaf 1)\]╔═\[$(tput setaf 2)\]\u@\H; $machine \n\[$(tput setaf 1)\]╠════\[$(tput setaf 6)\]\d, \t \n\[$(tput setaf 1)\]╚═\[$(tput setaf 7)\]\w:\[$(tput sgr0)\]"
alias reboot='sudo reboot'
alias update='sudo apt-get upgrade'
alias kubeshell='echo kubectl run -i --tty busybox --image=busybox --restart=Never -- sh'
alias ls='ls -alh --color=auto' ## Use a long listing format ##
alias ll='ls -la' ## Show hidden files ##
alias l.='ls -d .* --color=auto'
alias cd..='cd ..'
alias grep='grep --color=auto'
alias ports='sudo netstat -tulanp'
alias apt-get="sudo apt-get"
alias update="sudo apt-get update"
alias upgrade="sudo apt-get upgrade"
alias shutdown="sudo shutdown -h now"
alias wget="wget -c"
alias size="du -hs $(pwd)"
alias swagger="docker run -d -p 5050:8080 swaggerapi/swagger-editor"
###################
#####FUNCTIONS#####
###################
function extract() {
if [ -z "$1" ]; then
# display usage if no parameters given
echo "Usage: extract <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|ex|tar.bz2|tar.gz|tar.xz>"
echo " extract <path/file_name_1.ext> [path/file_name_2.ext] [path/file_name_3.ext]"
return 1
else
for n in $@; do
if [ -f "$n" ]; then
case "${n%,}" in
*.tar.bz2 | *.tar.gz | *.tar.xz | *.tbz2 | *.tgz | *.txz | *.tar) tar xvf "$n" ;;
*.lzma) unlzma ./"$n" ;;
*.bz2) bunzip2 ./"$n" ;;
*.rar) unrar x -ad ./"$n" ;;
*.gz) gunzip ./"$n" ;;
*.zip) unzip ./"$n" ;;
*.z) uncompress ./"$n" ;;
*.7z | *.arj | *.cab | *.chm | *.deb | *.dmg | *.iso | *.lzh | *.msi | *.rpm | *.udf | *.wim | *.xar)
7z x ./"$n"
;;
*.xz) unxz ./"$n" ;;
*.exe) cabextract ./"$n" ;;
*)
echo "extract: '$n' - unknown archive method"
return 1
;;
esac
else
echo "'$n' - file does not exist"
return 1
fi
done
fi
}
function internet() {
if ! [ -x "$(command -v speedtest-cli)" ]; then
echo Error: speedtest-cli not installed. Installing.
apt install speedtest-cli
fi
speedtest-cli >&1
echo Ping time to google: $(ping -c 1 google.com | grep -oh "time=[0-9.]*") ms
}