more funcs

This commit is contained in:
Jason Swank 2025-10-24 15:27:01 +00:00
parent a474758772
commit fc1cddac13
No known key found for this signature in database
3 changed files with 21 additions and 6 deletions

View File

@ -0,0 +1,14 @@
aws-list-records() {
# list route53 hosted zone ids and names, select the zone id using fzf
local zone_id
zone_id=$(aws route53 list-hosted-zones \
| jq -r '.HostedZones[] | "\(.Id | split("/")[2]) \(.Name)"' \
| fzf --header="$(printf '%-21s %s' 'Zone ID' 'Name')" \
| awk '{print $1}')
[[ -z "$zone_id" ]] && return 1
printf "# zone id: %s\n" "$zone_id"
aws route53 list-resource-record-sets --hosted-zone-id "$zone_id" | \
jq -r '.ResourceRecordSets[] | "\(.Name)\t\(.Type)\t\(.ResourceRecords[]?.Value)"'
}

View File

@ -0,0 +1,3 @@
aws-logout() {
unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_ENVIRONMENT
}

View File

@ -88,9 +88,9 @@ if [ -e $HOME/cfa-work/.zshrc ]; then
. $HOME/cfa-work/.zshrc
fi
for env in $HOME/.okta/.env $HOME/.config/aws/.env $HOME/.config/github/.env $HOME/.config/aichat/.env; do
if [ -r $env ]; then
export $(xargs < $env)
for env in $HOME/.config/*/.env; do
if [ -r "$env" ]; then
export $(xargs < "$env")
fi
done
@ -131,5 +131,3 @@ zstyle :compinstall filename '~/.zshrc'
#zstyle :compinstall filename '~/.zshrc'
#compinit
complete -o nospace -C /home/cli/dotfiles/zsh/.local/bin/tofu tofu