Skip to content

Instantly share code, notes, and snippets.

@trajano
Last active October 11, 2019 20:01
Show Gist options
  • Save trajano/71553de32f335092ad62f2f301cadd0f to your computer and use it in GitHub Desktop.
Save trajano/71553de32f335092ad62f2f301cadd0f to your computer and use it in GitHub Desktop.
Bash RC
dsreload() {
IMAGE=$(docker service inspect -f "{{.Spec.TaskTemplate.ContainerSpec.Image}}" $1 | cut -f1 -d"@")
docker service update --force --image $IMAGE $1
}
cd() {
if [ $# -eq 0 ]
then
builtin pushd ${HOME} > /dev/null
else
builtin pushd "$1" >& /dev/null || builtin cd "$1"
fi
}
pullbashrc() {
curl -s https://gist.githubusercontent.com/trajano/71553de32f335092ad62f2f301cadd0f/raw/.bashrc > /tmp/bashrc
echo >> /tmp/bashrc
sed -n '/^###/,$p' ~/.bashrc >> /tmp/bashrc
mv -f /tmp/bashrc ~/.bashrc
}
.() {
if [ $# -eq 0 ]
then
builtin source ${HOME}/.bash_profile
else
builtin source $1
fi
}
alias ..="cd .."
alias ls="ls -hNFCs --color=auto -I NTUSER.DAT\* -I ntuser.dat\*"
alias mv="mv -i"
alias cp="cp -i"
alias rm="rm -i"
alias df="df -h"
alias du="du -h"
alias curl="curl -s"
alias c1="awk '{ print \$1 }'"
alias c2="awk '{ print \$2 }'"
alias c3="awk '{ print \$3 }'"
alias c4="awk '{ print \$4 }'"
alias dcp="docker container prune -f"
if (which scoop >& /dev/null)
then
alias sup='scoop update \*'
fi
# CDPATH=.:$HOME:$HOME/Desktop:/c:/d:/d/p:/d/dh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment