killport, installed commands and efremove

This commit is contained in:
Rick van Lieshout 2018-08-22 09:16:10 +02:00
parent 8d6fb1bf62
commit 015f706e54

View File

@ -29,6 +29,7 @@ alias psmem='ps auxf | sort -nr -k 5 | head -n 5'
#dotnet core #dotnet core
alias efupdate="dotnet ef database update" alias efupdate="dotnet ef database update"
alias efmigrate="dotnet ef migrations add" alias efmigrate="dotnet ef migrations add"
alias efremove="dotnet ef migrations remove"
alias dotnetnew="dotnet new webapi -o " alias dotnetnew="dotnet new webapi -o "
##utility ##utility
@ -57,6 +58,8 @@ alias cmyip='curl -s http://ipecho.net/plain; echo'
alias mkdir='mkdir -p' alias mkdir='mkdir -p'
alias wget='wget -c' alias wget='wget -c'
alias ls='ls --color=auto' alias ls='ls --color=auto'
alias installed='sudo pacman -Qetq'
alias aurinstalled='sudo pacman -Qmq'
alias sudo='sudo ' alias sudo='sudo '
# grub # grub
@ -67,38 +70,38 @@ alias update-grub='grub-mkconfig -o /boot/grub/grub.cfg'
# function to cd up a couple of times # function to cd up a couple of times
# USAGE: up 3 (goes up 3 directories) # USAGE: up 3 (goes up 3 directories)
up(){ up(){
DEEP=$1; DEEP=$1;
[ -z "${DEEP}" ] && { DEEP=1; }; [ -z "${DEEP}" ] && { DEEP=1; };
for i in $(seq 1 ${DEEP}); do for i in $(seq 1 ${DEEP}); do
cd ../; cd ../;
done; done;
} }
# function to extract ... well anything really # function to extract ... well anything really
extract () { extract () {
if [ -f $1 ] ; then if [ -f $1 ] ; then
case $1 in case $1 in
*.tar.bz2) tar xvjf $1 ;; *.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;; *.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;; *.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;; *.rar) unrar x $1 ;;
*.gz) gunzip $1 ;; *.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;; *.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;; *.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;; *.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;; *.zip) unzip $1 ;;
*.Z) uncompress $1 ;; *.Z) uncompress $1 ;;
*.7z) 7z x $1 ;; *.7z) 7z x $1 ;;
*) echo "don't know how to extract '$1'..." ;; *) echo "don't know how to extract '$1'..." ;;
esac esac
else else
echo "'$1' is not a valid file!" echo "'$1' is not a valid file!"
fi fi
} }
# function to return uptime in a human readable format # function to return uptime in a human readable format
myuptime () { myuptime () {
uptime | awk '{ print "Uptime:", $3, $4, $5 }' | sed 's/,//g' uptime | awk '{ print "Uptime:", $3, $4, $5 }' | sed 's/,//g'
return; return;
} }
# function to check whether a specific host is up # function to check whether a specific host is up
@ -108,12 +111,21 @@ isup(){
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$1 Seems to be offline"; echo "$1 Seems to be offline";
else else
echo "$1 Seems to be online"; echo "$1 Seems to be online";
fi fi
fi fi
} }
# function to print a line across the screen # function to print a line across the screen
printLine(){ printLine(){
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -
} }
# function to kill a port
killport () {
if [ -z "$1" ] ; then
echo "please specify a port to kill"
else
fuser -k $1/tcp
fi
}