Compare commits
6 Commits
vim-colors
...
fd47330e6d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd47330e6d | ||
|
|
9ec3e1124b | ||
|
|
c36d1fa1f8 | ||
|
|
a7804cc129 | ||
|
|
983a7abab8 | ||
| aef5a71ea1 |
@@ -1,12 +1,12 @@
|
||||
# local network -> local port
|
||||
Match Host tuulikki.scalene.net exec "sudo ping -c 1 -W 1 -q 192.168.101.1"
|
||||
Match Host tuulikki.scalene.net exec "nc -w 1 192.168.101.1 22"
|
||||
Port 22
|
||||
|
||||
Host tuulikki.scalene.net
|
||||
Port 22022
|
||||
|
||||
# local network -> local port
|
||||
Match Host tonttu.scalene.net exec "sudo ping -c 1 -W 1 -q 192.168.101.1"
|
||||
Match Host tonttu.scalene.net exec "nc -w 1 192.168.101.1 22"
|
||||
Port 22
|
||||
|
||||
Host tonttu.scalene.net
|
||||
@@ -16,7 +16,7 @@ Host www.scalene.net
|
||||
User scalene
|
||||
Port 22022
|
||||
|
||||
Match Host git.scalene.net exec "sudo ping -c 1 -W 1 -q 192.168.101.1"
|
||||
Match Host git.scalene.net exec "nc -w 1 192.168.101.1 22"
|
||||
Hostname tonttu.scalene.net
|
||||
|
||||
Host *.scalene.net
|
||||
|
||||
@@ -69,6 +69,9 @@ au FileType markdown setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4 wra
|
||||
" typing idate inserts the current date
|
||||
iab idate <c-r>=strftime("%Y-%m-%d")<cr>
|
||||
|
||||
" insert triple backticks for markdown code blocks with Ctrl-b
|
||||
inoremap <C-b> ```<CR>```<Esc>O
|
||||
|
||||
" use \ toc to insert a table of contents for markdown from the current line to EOF
|
||||
" nmap <leader>toc <cmd>.put =execute('.,$write !gh-md-toc --hide-header --hide-footer')<cr>
|
||||
nmap <leader>toc :put =system('gh-md-toc --hide-header --hide-footer --indent=4', getline('.', '$'))<cr>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# {{format-date now '%Y-%m-%d'}}
|
||||
|
||||
[yesterday](daily/{{format-date (date "yesterday") '%Y%m%d'}}.md)
|
||||
[Yesterday](daily/{{format-date (date "yesterday") '%Y%m%d'}}.md)
|
||||
[Weekly Goals](daily/weekly-goals.md)
|
||||
|
||||
## goals
|
||||
- a bullet
|
||||
|
||||
17
zsh/.local/share/zsh/functions/aws-get-bedrock-profile
Normal file
17
zsh/.local/share/zsh/functions/aws-get-bedrock-profile
Normal file
@@ -0,0 +1,17 @@
|
||||
aws-get-bedrock-profile () {
|
||||
profile_arn=$(aws bedrock list-inference-profiles \
|
||||
| jq -r '.inferenceProfileSummaries
|
||||
| map(select(.inferenceProfileId | startswith("us.")))
|
||||
| sort_by(.inferenceProfileName)
|
||||
| .[]
|
||||
| [.inferenceProfileArn, .inferenceProfileName, .description]
|
||||
| @tsv' \
|
||||
| fzf \
|
||||
--header="$(printf '%-30s\t%s\n' 'NAME' 'DESCRIPTION')" \
|
||||
--no-preview \
|
||||
--delimiter='\t' \
|
||||
--with-nth=2,3 \
|
||||
| awk '{print $1}')
|
||||
[[ -z "$profile_arn" ]] && return 1
|
||||
echo "$profile_arn"
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
aws-logout() {
|
||||
unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_ENVIRONMENT
|
||||
unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_ENVIRONMENT AWS_PROFILE
|
||||
}
|
||||
|
||||
30
zsh/.local/share/zsh/functions/aws-sso-login
Normal file
30
zsh/.local/share/zsh/functions/aws-sso-login
Normal file
@@ -0,0 +1,30 @@
|
||||
aws-sso-login() {
|
||||
local profile="${1:-$AWS_PROFILE}"
|
||||
|
||||
if [[ -z "$profile" ]]; then
|
||||
profile=$(aws configure list-profiles \
|
||||
| fzf --height 40% --reverse --no-preview)
|
||||
fi
|
||||
|
||||
if [[ -z "$profile" ]]; then
|
||||
echo "Error: No profile provided or selected." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Validate existing session; login if expired or missing
|
||||
if ! aws sts get-caller-identity --profile "$profile" &>/dev/null; then
|
||||
aws sso login --use-device-code --profile "$profile" || return 1
|
||||
fi
|
||||
|
||||
# Export credentials to environment for third-party tools
|
||||
local creds
|
||||
creds=$(aws configure export-credentials --profile "$profile" --format env)
|
||||
if [[ $? -eq 0 ]]; then
|
||||
eval "$creds"
|
||||
export AWS_PROFILE="$profile"
|
||||
# echo "Environment configured for profile: $profile"
|
||||
else
|
||||
echo "Error: Failed to export credentials." >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
@@ -48,9 +48,9 @@ zstyle ':vcs_info:git*' actionformats '%%S%r%%s:%{$fg[red]%}%b:%a%{$reset_color%
|
||||
|
||||
function set_prompt() {
|
||||
|
||||
if [[ -n "$AWS_ENVIRONMENT" ]]; then
|
||||
if [[ -n "$AWS_PROFILE" ]]; then
|
||||
aws_prompt="
|
||||
%S%B$AWS_ENVIRONMENT%b%s
|
||||
%S%B$AWS_PROFILE%b%s
|
||||
"
|
||||
else
|
||||
aws_prompt=""
|
||||
|
||||
Reference in New Issue
Block a user