Created
May 1, 2019 06:57
-
-
Save zaenk/2663d72e3c60b99781b76fbb4fe63026 to your computer and use it in GitHub Desktop.
Git Bash for Windows with some proxy commands to WLS
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
#!/bin/bash | |
alias wbash="/c/Windows/System32/bash.exe" | |
convert_path() { | |
# repace GitBash /driveletters with WLS bash /mnt/driveletters | |
# note: this not works with 1 letter directory letters | |
params=$(echo $* | sed -e "s/\/\b\(.\)\//\/mnt\/\1\//g") | |
echo $params | |
} | |
ansible() { | |
params=$(convert_path $*) | |
wbash -c "ansible $params" | |
} | |
ansible-playbook() { | |
params=$(convert_path $*) | |
wbash -c "ansible-playbook $params" | |
} | |
ansible-galaxy() { | |
params=$(convert_path $*) | |
wbash -c "ansible-galaxy $params" | |
} | |
ansible-vault() { | |
params=$(convert_path $*) | |
wbash -c "ansible-vault $params" | |
} | |
dtop() { | |
while true; do clear; docker ps -a; sleep 5; done; | |
} | |
dhtop() { | |
docker stats --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}\t{{.Name}}" | |
} | |
mysql_pw() { | |
echo -n "$1" | openssl sha1 -binary | openssl sha1 | tr 'a-z' 'A-Z' | awk '{ print "*"$2; }' | |
} | |
rsync() { | |
params=$(convert_path $*) | |
wbash -c "rsync $params" | |
} | |
export -f convert_path | |
export -f rsync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment