Last active
November 11, 2019 23:21
-
-
Save yspreen/283bf42ca62a98dbbcbccd93d1e5ac49 to your computer and use it in GitHub Desktop.
Useful bash snippets
This file contains hidden or 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
alias dockerlogs='docker exec -i -t `docker ps | grep '\''python man'\'' | grep -o '\''^[^ ]*'\''` bash' | |
alias gitrmbranches='git branch --merged | grep -v \* | xargs git branch -D' | |
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d | |
alias random_pw='LC_ALL=C tr -dc "A-Za-z0-9-_" </dev/urandom | head -c 20 ; echo' | |
alias kraken='LC_CTYPE=C open -na GitKraken --args -p "$(git rev-parse --show-toplevel)"' | |
alias wifion='networksetup -setnetworkserviceenabled Wi-Fi on' | |
alias wifioff='networksetup -setnetworkserviceenabled Wi-Fi off' | |
function list_all() { | |
emulate -L zsh | |
[ -f .pyenv/bin/activate ] && source .pyenv/bin/activate | |
} | |
chpwd_functions=(${chpwd_functions[@]} "list_all") | |
random-string() | |
{ | |
cat /dev/urandom | base64 | sed 's/\//_/' | fold -w ${1:-32} | head -n 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment