Last active
July 15, 2024 20:19
-
-
Save GammaGames/4f973b3b71252a94b72f62e8907c7d80 to your computer and use it in GitHub Desktop.
~/.bashrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export EDITOR=vim | |
fortune | cowsay -f duck | lolcat | |
alias grit=". /home/$USER/Documents/grit/grit" | |
alias please='sudo $(fc -ln -1)' | |
alias pyss="python3 /home/$USER/Documents/pyss/pyss.py" | |
alias serv='python3 -m http.server' | |
alias timer='echo "Ctrl+C to stop"; time cat' | |
alias update='sudo apt update && apt list --upgradable' | |
alias upgrade='sudo apt upgrade && sudo apt autoremove && flatpak update && flatpak remove --unused && update' | |
alias calc='bc' | |
alias c='code' | |
alias p='python3' | |
alias d='dvtm' | |
alias dc-rebuild='docker-compose build --no-cache && docker-compose up' | |
alias dc-rebuild-dev='docker-compose -f docker-compose.dev.yaml build --no-cache && docker-compose -f docker-compose.dev.yaml up' | |
alias pipreq='pipreqs . --force' | |
alias path='export PATH=$PATH:$PWD' | |
alias cleanDir='find . -mtime +7 -exec gio trash {} \;' | |
alias sudirenv='sudo direnv exec' | |
alias server='ssh username@server' | |
alias serverfs="sshfs username@server:/home/username /home/$USER/server/" | |
alias xserverfs="fusermount -u -z /home/$USER/server" | |
alias reserverfs='xserverfs && serverfs' | |
# dip [id] - Prints out a container's name, IP, and port. If no id provided, prints info for all containers. | |
function dip() { | |
if [ -z $1 ]; then | |
docker ps -a --format "{{.ID}}" | while read -r line ; do | |
echo $line $(docker inspect --format "{{.Config.Image}} {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" $line | sed 's/\///'):$(docker port "$line" | grep -o "0.0.0.0:.*" | cut -f2 -d:) | |
done | |
else | |
echo $(docker inspect --format "{{.Config.Image}} {{.ID }} {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" $1 | sed 's/\///'):$(docker port "$1" | grep -o "0.0.0.0:.*" | cut -f2 -d:) | |
fi | |
} | |
# dsh [id] - Attach a shell to a docker with an id | |
function dsh() { | |
docker exec -it $1 /bin/sh -c "[ -e /bin/bash ] && /bin/bash || /bin/sh" | |
} | |
# From http://broken-by.me/lazy-load-nvm/ | |
nvm() { | |
unset -f nvm | |
export NVM_DIR=~/.nvm | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
nvm "$@" | |
} | |
node() { | |
unset -f node | |
export NVM_DIR=~/.nvm | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
node "$@" | |
} | |
npm() { | |
unset -f npm | |
export NVM_DIR=~/.nvm | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
npm "$@" | |
} | |
weather() { | |
local request="wttr.in/location?0&F&Q" | |
[ "$COLUMNS" -lt 125 ] && request+='?n' | |
curl -s -H "Accept-Language: ${LANG%_*}" --compressed "$request" | |
} | |
. /home/$USER/Documents/z/z.sh | |
eval "$(direnv hook bash)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment