-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaslow
41 lines (33 loc) · 968 Bytes
/
maslow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
export PATH=$PATH:$HOME/promotedai/bin
[ -f ~/.cargo/env ] && . ~/.cargo/env
hgetall() {
if [ -z $3 ] ; then
echo "usage: hgetall hostname port key [db#]"
else
db=${4:-0}
redis-cli -h $1 -p $2 -n $db hgetall "$3" | cut -f2 -d\ | paste -d\ - -
fi
}
ytp() {
yt-dlp -f bestaudio ytsearch:"$1" -o - 2>/dev/null | ffplay -nodisp -autoexit -i -
}
_aws_vault_info() {
[ -z $AWS_VAULT ] && return
local color=001
[ $(date -ju +"%s") -lt $(TZ=UTC date -jf "%FT%TZ" $AWS_SESSION_EXPIRATION +"%s") ] && color=002
echo -e " %{%F{$color}%}\u26bf${AWS_VAULT}%{%f%}"
}
_kube_info() {
[ -z $KUBECONFIG ] && return
echo -e " %{%F{012}%}\u2388${KUBECONFIG##*/}%{%f%}"
}
cdp() {
cd ~/promotedai/$1
}
compdef '_files -/ -W ~/promotedai' cdp
# prompt
if [ "$TERM" != 'dumb' ] && [ $USER != 'root' ] ; then
RPROMPT="\$(_aws_vault_info)\$(_kube_info)\$vcs_info_msg_0_"
fi
export AWS_SESSION_TOKEN_TTL=24h
# vim: set ft=zsh : #