1
0
Fork 0
zsh/bearstech.zsh

30 lines
1.3 KiB
Bash
Raw Normal View History

2017-04-06 16:26:30 +02:00
# Some exports
export INFRA=/home/hybris/dev/bearstech/bearstech/infra
export PATH=$INFRA/bin:$INFRA/../xen:$PATH
# Everyday aliases
2017-06-01 10:58:58 +02:00
bt-alerts() {ssh root@pidou monshow | grep -v "none$" | grep -v "^ " | grep -v "^$"}
bt-dom0() {awk '/Container:/{ print $2}' ${INFRA}/host/${1}}
bt-each() {$INFRA/bin/foreach $@}
bt-host() {cat $INFRA/host/$1}
2018-04-25 15:30:02 +02:00
bt-release() {ssh root@$1 cat /etc/debian_version}
2017-10-19 14:35:10 +02:00
bt-tickets() {echo "Tickets:$(curl -s "https://maudin:$(/home/hybris/.scripts/keepcli -p Dashbeard)@dashbeard.bearstech.com/api/dashbeard.txt")"}
2017-04-06 16:26:30 +02:00
# Google Cloud
# The next line updates PATH for the Google Cloud SDK.
source '/home/hybris/dev/bearstech/google-cloud-sdk/path.zsh.inc'
# The next line enables shell command completion for gcloud.
source '/home/hybris/dev/bearstech/google-cloud-sdk/completion.zsh.inc'
2017-05-24 17:34:36 +02:00
# OVH cloud
2018-04-25 15:30:02 +02:00
nova-env() {source $INFRA/cloud/ovh-$1.env}
# Some completion functions
_complete_bt-host() {reply=($(ls $INFRA/host))}
_complete_nova-env() {reply=($(ls $INFRA/cloud/ovh-*.env | sed "s@$INFRA/cloud/ovh-\(.*\).env@\1@"))}
compctl -K _complete_bt-host bt-dom0
compctl -K _complete_bt-host bt-host
compctl -K _complete_bt-host bt-release
2018-04-25 15:33:58 +02:00
compctl -K _complete_bt-host r
2018-04-25 15:30:02 +02:00
compctl -K _complete_nova-env nova-env