Skip to content

Instantly share code, notes, and snippets.

@teodorpatras
Last active October 23, 2019 13:55
Show Gist options
  • Save teodorpatras/d44f5661e0c4c28fd6f90b71a2900fa5 to your computer and use it in GitHub Desktop.
Save teodorpatras/d44f5661e0c4c28fd6f90b71a2900fa5 to your computer and use it in GitHub Desktop.
My .bashrc
alias dstop='docker kill $(docker ps -q)'
alias rmdc='docker rm $(docker ps -a -q)'
alias rmdi='docker rmi $(docker images --filter "dangling=true" -q --no-trunc)'
alias df='df -h '
alias cp='cp -rv'
# List contents with colors for file types, (a)ll hidden entries (including . and ..), use (l)ong listing format, with class indicators (F)
alias ll='ls -alF'
# Explain (v) what was done when moving a file
alias mv='mv -v'
# Create any non-existent (p)arent directories and explain (v) what was done
alias mkdir='mkdir -pv'
# Always try to (c)ontinue getting a partially-downloaded file
alias wget='wget -c'
alias fhere="find . -name "
alias du="du -ach | sort -h"
alias histg="history | grep"
alias myip="curl http://ipecho.net/plain; echo"
alias gdlb='git branch -D'
gdrb() {
git push origin :$1 --no-verify
}
dexec() {
container=$1;
shift;
docker exec -ti $container $@
}
cph() { git commit -m $1 && git push }
gurl() {
url=$(git config --get remote.origin.url)
url="${url/://}"
url="${url/git@/https://}"
echo ${url%.git*} ${url##*.git}
}
ghpq () {
base=$1
branch=$(git name-rev --name-only HEAD)
url="$(gurl)"
open "${url}/compare/${base}...${branch}"
}
ghps() {
url="$(gurl)"
open "${url}/pulls"
}
ghi() {
url="$(gurl)"
open "${url}/issues"
}
ghub() {
open $(gurl)
}
bk() {
for file in "$@"
do
cp $file{,.bak}
done
}
lexit() {
# Display the exit status of the last run command
exit_status=$?
echo "Exit $exit_status"
}
cd () {
builtin cd "$1"
ls -ACF
}
psg() {
ps aux | grep -v grep | grep -i -e $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment