From 1b2c880aef90d92a82e71368c1e9bcab6d8e217b Mon Sep 17 00:00:00 2001 From: Jason Swank Date: Thu, 28 Nov 2024 15:50:13 +0000 Subject: [PATCH 1/6] ssh: clean up pscalene config --- ssh/.ssh/scalene-config | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/ssh/.ssh/scalene-config b/ssh/.ssh/scalene-config index 46769e9..303ed14 100644 --- a/ssh/.ssh/scalene-config +++ b/ssh/.ssh/scalene-config @@ -1,18 +1,3 @@ -Host nyyrikki-vpn - Hostname 10.147.19.238 - -Host tuulikki-vpn - Hostname 10.147.19.243 - -Host tonttu-vpn - Hostname 10.147.19.60 - -Host nyyrikki - Hostname 192.168.101.110 - -Host tuulikki - Hostname 192.168.101.69 - Host tuulikki.scalene.net Port 22022 From 4c368a5a90af76a2f70d1a606319645c33b5658c Mon Sep 17 00:00:00 2001 From: Jason Swank Date: Thu, 19 Dec 2024 12:58:50 +0000 Subject: [PATCH 2/6] tmux: update meta key --- tmux/.config/tmux/tmux.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf index 7dbd75a..19b5417 100644 --- a/tmux/.config/tmux/tmux.conf +++ b/tmux/.config/tmux/tmux.conf @@ -1,7 +1,7 @@ # CTRL-A -> TMUX KEY -set-option -g prefix C-a +set-option -g prefix ` unbind-key C-b -bind-key C-a send-prefix +bind-key ` send-prefix # VI-style keybindings setw -g mode-keys vi From 2d9108c0c5ae260dc33d8f180be852c7ecab92f5 Mon Sep 17 00:00:00 2001 From: Jason Swank Date: Mon, 30 Dec 2024 16:23:42 +0000 Subject: [PATCH 3/6] zsh: prompt / vcs --- zsh/.zshrc | 81 +++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index dc5e926..c9120c7 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -1,5 +1,4 @@ alias ls='ls --color=auto' -alias mailx='/usr/local/bin/mailx' alias grep='grep --color' alias vim='nvim' alias vi='nvim' @@ -8,23 +7,52 @@ alias w3='w3m -T text/html' # allow for # to be interpreted as a comment on the command line setopt interactivecomments -PROMPT="%B%m:%~> %b" - # cd tricks alias -- -='cd -' setopt auto_cd # there is no binary by that name in your $PATH, your shell will cd into it that directory +# use vi-style keymap bindkey -v if [ "${TERM}" = "xterm" ]; then TERM=xterm-256color fi -case $TERM in - xterm*|st-256color|rxvt-unicode-256color) - print -Pn "\e]0;%m\a" - ;; -esac +# +# Prompt setup +# + +# populate colors arrays +autoload -U colors && colors + +# git branch prompt +autoload -Uz vcs_info +setopt prompt_subst + +precmd_vcs_info() { vcs_info } +precmd_functions+=( precmd_vcs_info ) + +# %% escapes '%' +# %S == "standout" => reverses fg/bg +# Surround color codes with '%{' and '%}' +# %r == repo name +# %b == branch name +# %S == relative directory +zstyle ':vcs_info:git*' formats '%%S%r%%s:%{$fg[red]%}%b%{$reset_color%} %S' +zstyle ':vcs_info:git*' actionformats '%%S%r%%s:%{$fg[red]%}%b:%a%{$reset_color%} %S' + +function set_prompt() { + if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + PROMPT="%B${vcs_info_msg_0_}> %b" + else + PROMPT="%B%m:%~> %b" + fi +} +precmd_functions+=( set_prompt ) + +# +# Configure SSH auth sock +# if [ -n "$SSH_AUTH_SOCK" ]; then if [ "$SSH_AUTH_SOCK" != ~/.ssh/ssh_auth_sock ]; then @@ -33,6 +61,7 @@ if [ -n "$SSH_AUTH_SOCK" ]; then fi fi +# setup SSH keys if [ -e /usr/bin/keychain ]; then eval $(/usr/bin/keychain --eval --agents ssh -Q --quiet id_ed25519) fi @@ -43,33 +72,6 @@ whence -p direnv &>/dev/null && eval "$(direnv hook zsh)" # Highlight the current autocomplete option zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" -# asdf setup -if [ -e $HOME/.asdf/asdf.sh ]; then - . "$HOME/.asdf/asdf.sh" - fpath=(${ASDF_DIR}/completions $fpath) -fi - -# git branch prompt -setopt prompt_subst -autoload -Uz vcs_info -zstyle ':vcs_info:*' actionformats \ - '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' -zstyle ':vcs_info:*' formats \ - '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f ' -zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' - -zstyle ':vcs_info:*' enable git cvs svn - - -# Better SSH/Rsync/SCP Autocomplete -#zstyle ':completion:*:(scp|rsync):*' tag-order ' hosts:-ipaddr:ip\ address hosts:-host:host files' -#zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost ip6-localhost broadcasthost -#zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*' -# -# Allow for autocomplete to be case insensitive -#zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' \ -# '+l:|?=** r:|?=**' - # command line completion for ssh h=() if [[ -r ~/.ssh/config ]]; then @@ -85,12 +87,3 @@ fi zstyle :compinstall filename '~/.zshrc' autoload -Uz compinit compinit - -# The following lines were added by compinstall - -#zstyle ':completion:*' completer _complete _ignored -#zstyle :compinstall filename '~/.zshrc' -# -#autoload -Uz compinit -#compinit -# End of lines added by compinstall From 54a540e31f4c1b61af4b3f60fe1c515515628681 Mon Sep 17 00:00:00 2001 From: Jason Swank Date: Tue, 31 Dec 2024 14:08:04 +0000 Subject: [PATCH 4/6] zsh: move path def --- zsh/.zshenv | 8 ++++---- zsh/.zshrc | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/zsh/.zshenv b/zsh/.zshenv index e21c377..665c755 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -13,9 +13,9 @@ export FZF_DEFAULT_OPTS="--multi --height=40% --layout=reverse" export GOPATH=~/go # doesn't work on arch for tmux -path+=(~/bin) -path+=(~/.local/bin) -path+=($GOPATH/bin) -export PATH +#path+=(~/bin) +#path+=(~/.local/bin) +#path+=($GOPATH/bin) +#export PATH export TMPDIR=/var/tmp diff --git a/zsh/.zshrc b/zsh/.zshrc index c9120c7..84b394c 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -4,6 +4,11 @@ alias vim='nvim' alias vi='nvim' alias w3='w3m -T text/html' +path+=(~/bin) +path+=(~/.local/bin) +path+=($GOPATH/bin) +export PATH + # allow for # to be interpreted as a comment on the command line setopt interactivecomments From 4e0c750e704a504eca9a87ed485e21be15d6962b Mon Sep 17 00:00:00 2001 From: Jason Swank Date: Tue, 31 Dec 2024 15:06:34 +0000 Subject: [PATCH 5/6] aichat: add --- aichat/.config/aichat/.gitignore | 1 + aichat/.config/aichat/config.yaml | 10 ++++++++++ aichat/.config/aichat/roles/cloudops.md | 10 ++++++++++ aichat/.config/aichat/roles/log.md | 6 ++++++ 4 files changed, 27 insertions(+) create mode 100644 aichat/.config/aichat/.gitignore create mode 100644 aichat/.config/aichat/config.yaml create mode 100644 aichat/.config/aichat/roles/cloudops.md create mode 100644 aichat/.config/aichat/roles/log.md diff --git a/aichat/.config/aichat/.gitignore b/aichat/.config/aichat/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/aichat/.config/aichat/.gitignore @@ -0,0 +1 @@ +.env diff --git a/aichat/.config/aichat/config.yaml b/aichat/.config/aichat/config.yaml new file mode 100644 index 0000000..1a2f496 --- /dev/null +++ b/aichat/.config/aichat/config.yaml @@ -0,0 +1,10 @@ +# see https://github.com/sigoden/aichat/blob/main/config.example.yaml + +# set API keys via environment variables, like CLAUDE_API_KEY +# environment variables for aichat can be set at ~/.config/aichat/.env + +model: claude +keybindings: vi +prelude: role:cloudops +clients: +- type: claude diff --git a/aichat/.config/aichat/roles/cloudops.md b/aichat/.config/aichat/roles/cloudops.md new file mode 100644 index 0000000..0e53d07 --- /dev/null +++ b/aichat/.config/aichat/roles/cloudops.md @@ -0,0 +1,10 @@ +I want you to act as a UNIX shell expert and senior software engineer. + +You are working in an environment with services using Amazon Web Services (AWS), including EKS, ALB, VPC, Transit Gateways. +Tools you are currently using include Terraform, git (Github), the AWS CLI, kubectl, `jq`, `yy`. + +You are a Go program language expert. + +Explanations should be terse. + +Please include relevant fenced code blocks as part of your response. diff --git a/aichat/.config/aichat/roles/log.md b/aichat/.config/aichat/roles/log.md new file mode 100644 index 0000000..b4d3bb4 --- /dev/null +++ b/aichat/.config/aichat/roles/log.md @@ -0,0 +1,6 @@ +I want you to act as a UNIX shell expert and senior software engineer. + +You are working in an environment with services using Amazon Web Services (AWS), including EKS, ALB, VPC, Transit Gateways. +Tools you are currently using include Terraform, git (Github), the AWS CLI, kubectl, `jq`, `yy`. + +Please explain the following log message. Unless indicated otherwise, please be terse and concise with your explanation. From e25d0f0ff5ea7d5bdce5ae4b3a08c81e1cdebb0c Mon Sep 17 00:00:00 2001 From: Jason Swank Date: Tue, 31 Dec 2024 17:30:59 +0000 Subject: [PATCH 6/6] ignore .env files --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1e5c14a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +**/*.env