This commit is contained in:
Rick van Lieshout 2018-09-02 11:32:04 +02:00
commit 27ecf7b341
2 changed files with 45 additions and 29 deletions

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,48 +58,53 @@ 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
alias update-grub='grub-mkconfig -o /boot/grub/grub.cfg' alias update-grub='grub-mkconfig -o /boot/grub/grub.cfg'
# git
alias gitremovelocalbranches='git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d'
## Functions ## Functions
# 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 +114,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
} }

View File

@ -7,3 +7,4 @@
stats = !git graph --stat stats = !git graph --stat
pushall = !git remote | xargs -L1 git push --all pushall = !git remote | xargs -L1 git push --all
diffname = !git diff --name-only diffname = !git diff --name-only
undocommit = reset --soft HEAD~1