From a69638d6398e033235a6d81727249514f9e1fb1a Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Tue, 12 May 2026 10:48:29 -0700 Subject: [PATCH] monitors and aliases --- .zsh/aliases | 94 ++++++++++++++++++++++++++++--------- local/bin/dphdmi.sh | 15 +++--- local/bin/rotate-both.sh | 10 ++++ local/bin/rotate.sh | 15 +++--- local/bin/share-top-left.sh | 14 ++++++ 5 files changed, 112 insertions(+), 36 deletions(-) create mode 100755 local/bin/rotate-both.sh create mode 100755 local/bin/share-top-left.sh diff --git a/.zsh/aliases b/.zsh/aliases index 6de23ae..8a3945f 100644 --- a/.zsh/aliases +++ b/.zsh/aliases @@ -18,7 +18,7 @@ alias z="TERM=xterm ssh hunner@zabava.cat.pdx.edu" alias o="TERM=xterm ssh hunner@osiris.cat.pdx.edu" alias m="TERM=xterm ssh hunner@mint.cic.pdx.edu" alias p="ping 8.8.8.8" -alias pi="ping google.com" +#alias pi="ping google.com" alias ph="ping pi.hole" alias pa="ping ads.google.com" alias pipe=pip # typos @@ -98,7 +98,8 @@ alias ry="vim -R +'set ft=yaml'" alias superscript="tr '+−=()0123456789AaÆᴂɐɑɒBbcɕDdðEeƎəɛɜɜfGgɡɣhHɦIiɪɨᵻɩjJʝɟKklLʟᶅɭMmɱNnɴɲɳŋOoɔᴖᴗɵȢPpɸrRɹɻʁsʂʃTtƫUuᴜᴝʉɥɯɰʊvVʋʌwWxyzʐʑʒꝯᴥβγδθφχнნʕⵡ' \ '⁺⁻⁼⁽⁾⁰¹²³⁴⁵⁶⁷⁸⁹ᴬᵃᴭᵆᵄᵅᶛᴮᵇᶜᶝᴰᵈᶞᴱᵉᴲᵊᵋᶟᵌᶠᴳᵍᶢˠʰᴴʱᴵⁱᶦᶤᶧᶥʲᴶᶨᶡᴷᵏˡᴸᶫᶪᶩᴹᵐᶬᴺⁿᶰᶮᶯᵑᴼᵒᵓᵔᵕᶱᴽᴾᵖᶲʳᴿʴʵʶˢᶳᶴᵀᵗᶵᵁᵘᶸᵙᶶᶣᵚᶭᶷᵛⱽᶹᶺʷᵂˣʸᶻᶼᶽᶾꝰᵜᵝᵞᵟᶿᵠᵡᵸჼˤⵯ';" alias resize="printf '\33]50;%s%d\007' 'xft:DroidSansMonoDotted:pixelsize=' $1" # ':antialias=true'" -alias amp="npx @sourcegraph/amp@latest" +#alias amp="npx @sourcegraph/amp@latest" +alias kilo="npx @kilocode/cli@latest" #alias asdf="xkbcomp -w0 ~/keymaps/xkb/hunner.xkb $DISPLAY" alias asdfg="setxkbmap us dvorak ctrl:nocaps" kinesis_activate() { @@ -242,7 +243,7 @@ else VIM=vi fi export VISUAL="$VIM -f" -export EDITOR="$VIM -f" +export EDITOR="$VIM" alias vh="mvim -c 'au VimLeave * maca hide:'" alias vi=$VIM alias vim=$VIM @@ -294,6 +295,7 @@ glf -- git short log just file names gp -- git push gr -- git remote -v show grs -- git restore --staged file +grim -- git rebase -i origin/main gs -- git status gst -- git stash gstp -- git stash pop @@ -316,6 +318,8 @@ alias gc="git commit" alias gca="git commit --amend" alias gfa="git fetch --all --prune" alias gr="git remote -v show" +alias grs="git restore --staged " +alias grim="git rebase -i origin/main" alias gp="git push" alias gu="git pull" alias gst="git stash" @@ -323,7 +327,6 @@ alias gstp="git stash pop" alias gdw="git diff --color-words" alias gk="gitk --all&" alias gx="gitx --all" -alias grs="git restore --staged " alias dvh="echo 'dvt -- create a local dev template dva -- add a dev template @@ -419,7 +422,8 @@ function dr() { cmd=$2 && [ -z $2 ] && cmd="/bin/bash" docker run -it --rm $1 $cmd ${@:3} } -alias d-c="docker-compose" +alias d-c="docker compose" +alias hx="hagent -x " # Terraform alias tfh="echo 'tf -- terraform @@ -433,7 +437,7 @@ alias tfs="terraform state" # K8s -alias kubectl="kubectl --context \${KUBE_CONTEXT:-\$(command kubectl config current-context 2>/dev/null)}" +alias kubectl="kubectl --context \${KUBE_CONTEXT:-\$(command kubectl config current-context 2>/dev/null)} --namespace \"\${KUBE_NAMESPACE:-\$(command kubectl config view --minify --output 'jsonpath={..namespace}' 2>/dev/null)}\"" alias kh="echo 'k -- kubectl kg -- kubectl get obj kgp -- kubectl get pod @@ -447,6 +451,7 @@ knl -- list namespaces kx -- switch context ... kxs -- set \$KUBE_CONTEXT kn -- switch namespace ... +kns -- set \$KUBE_NAMESPACE klf -- follow logs klfj -- follow logs with json formatting kat [cmd] -- attach and run cmd in pod @@ -466,7 +471,11 @@ alias kxl="kubectl config get-contexts" alias knl="kubectl get namespaces" alias kx="kubectl config use-context" function kxs() { export KUBE_CONTEXT="${1}" } -alias kn="kubectl config set-context --current --namespace" +function kns() { export KUBE_NAMESPACE="${1}" } +function kn() { + #if [ -z "$KUBE_NAMESPACE"] ; then + kubectl config set-context --current --namespace $1 +} alias klf="kubectl logs -f " function klfj() { [ -z $1 ] && echo 'usage: klfj ' && return 1 @@ -486,18 +495,59 @@ alias openapi="echo 'Serving ReDoc at http://localhost:8080' && docker run -it - # Pathing -export GO_DEV_ROOT="${DEV_ROOT}/go/src/github.com/puppetlabs" -alias gor="cd $GO_DEV_ROOT" -alias rapi="cd $GO_DEV_ROOT/relay-api" -alias rui="cd $GO_DEV_ROOT/relay-ui" -alias rcli="cd $GO_DEV_ROOT/relay" -alias djm="cd $DEV_ROOT/DistelliJavaModels" -alias k8s="cd $DEV_ROOT/K8SDashboard" -alias pwf="cd $DEV_ROOT/pfc-web-framework" -alias pvs="cd $DEV_ROOT/pipelines-version-set" -alias pfc="cd $DEV_ROOT/PipelinesForContainers" -alias apm="cd $DEV_ROOT/AppPipelineManager" -alias aem="cd $DEV_ROOT/AppEventsManager" -alias dwu="cd $DEV_ROOT/DistelliWebUi" -alias pac="cd $DEV_ROOT/PipelinesAsCode" -alias hm="cd $DEV_ROOT/HelmManager" +#export GO_DEV_ROOT="${DEV_ROOT}/go/src/github.com/puppetlabs" +#alias gor="cd $GO_DEV_ROOT" +#alias rapi="cd $GO_DEV_ROOT/relay-api" +#alias rui="cd $GO_DEV_ROOT/relay-ui" +#alias rcli="cd $GO_DEV_ROOT/relay" +#alias djm="cd $DEV_ROOT/DistelliJavaModels" +#alias k8s="cd $DEV_ROOT/K8SDashboard" +#alias pwf="cd $DEV_ROOT/pfc-web-framework" +#alias pvs="cd $DEV_ROOT/pipelines-version-set" +#alias pfc="cd $DEV_ROOT/PipelinesForContainers" +#alias apm="cd $DEV_ROOT/AppPipelineManager" +#alias aem="cd $DEV_ROOT/AppEventsManager" +#alias dwu="cd $DEV_ROOT/DistelliWebUi" +#alias pac="cd $DEV_ROOT/PipelinesAsCode" +#alias hm="cd $DEV_ROOT/HelmManager" +alias hin="cd ${DEV_ROOT}/hindex" + +# Use separate `agents` user for running AI agents +alias ah="echo 'agents -- run an agent command as the agents user +scodex -- run codex as the agents user, bypassing approvals and sandbox +sclaude -- run claude as the agents user, skipping permissions +sopencode -- run opencode as the agents user +ad -- cd to ~agents +aw -- cd to ~agents/validmind +abk -- cd to ~agents/validmind/backend'" +alias agents="sudo -u agents -i" +alias scodex="agents codex --dangerously-bypass-approvals-and-sandbox" +alias sclaude="agents claude --dangerously-skip-permissions" +alias sopencode="agents opencode" +alias ad="cd ~agents" +alias aw="cd ~agents/validmind" +alias abk="cd ~agents/validmind/backend" + +alias dcodex="codex --dangerously-bypass-approvals-and-sandbox" +alias dclaude="claude --dangerously-skip-permissions" + +function op_set() { + if [ "$#" -ne 1 ]; then + echo "Usage: op_add " + return 1 + fi + echo -n "Value: " + read -s password + if op item get --account haugens --vault shell --fields password "$1" > /dev/null 2>&1; then + op item edit --account haugens --vault shell "$1" "password=$password" + else + op item create --account haugens --vault shell --category login --title "$1" "password=$password" + fi +} +function op_get() { + if [ "$#" -ne 1 ]; then + echo "Usage: op_get <title>" + return 1 + fi + op item get --account haugens --vault shell --fields password --reveal "$1" 2>/dev/null +} diff --git a/local/bin/dphdmi.sh b/local/bin/dphdmi.sh index f7ca70b..185e174 100755 --- a/local/bin/dphdmi.sh +++ b/local/bin/dphdmi.sh @@ -1,9 +1,10 @@ #!/usr/bin/env bash -xrandr --output eDP-1 --auto -xrandr --output DP-2 --auto -xrandr --output DP-3 --auto -xrandr --output DP-2 --rotate normal -xrandr --output DP-3 --left-of eDP-1 -xrandr --output DP-2 --left-of DP-3 -xrandr --output DP-2 --primary +xrandr --output eDP --auto +xrandr --output DisplayPort-1 --auto +xrandr --output DisplayPort-2 --auto +xrandr --output DisplayPort-1 --rotate normal +xrandr --output DisplayPort-2 --rotate normal +xrandr --output DisplayPort-1 --left-of eDP +xrandr --output DisplayPort-2 --left-of DisplayPort-1 +xrandr --output DisplayPort-2 --primary diff --git a/local/bin/rotate-both.sh b/local/bin/rotate-both.sh new file mode 100755 index 0000000..40c70d4 --- /dev/null +++ b/local/bin/rotate-both.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +xrandr --output eDP --auto --scale 1x1 +xrandr --output DisplayPort-1 --auto --scale 1x1 +xrandr --output DisplayPort-2 --auto --scale 1x1 +xrandr --output DisplayPort-1 --rotate right +xrandr --output DisplayPort-2 --rotate left +xrandr --output DisplayPort-1 --left-of eDP +xrandr --output DisplayPort-2 --left-of DisplayPort-1 +xrandr --output DisplayPort-2 --primary diff --git a/local/bin/rotate.sh b/local/bin/rotate.sh index 4713a71..c8f7eab 100755 --- a/local/bin/rotate.sh +++ b/local/bin/rotate.sh @@ -1,9 +1,10 @@ #!/usr/bin/env bash -xrandr --output eDP-1 --auto -xrandr --output DP-2 --auto -xrandr --output DP-3 --auto -xrandr --output DP-2 --rotate right -xrandr --output DP-3 --left-of eDP-1 -xrandr --output DP-2 --left-of DP-3 -xrandr --output DP-2 --primary +xrandr --output eDP --auto +xrandr --output DisplayPort-1 --auto +xrandr --output DisplayPort-2 --auto +xrandr --output DisplayPort-1 --rotate normal +xrandr --output DisplayPort-2 --rotate right +xrandr --output DisplayPort-1 --left-of eDP +xrandr --output DisplayPort-2 --left-of DisplayPort-1 +xrandr --output DisplayPort-2 --primary diff --git a/local/bin/share-top-left.sh b/local/bin/share-top-left.sh new file mode 100755 index 0000000..5125390 --- /dev/null +++ b/local/bin/share-top-left.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if ! command -v xrandr >/dev/null 2>&1; then + echo "Missing required command: xrandr" >&2 + exit 1 +fi + +exec xrandr \ + --output eDP \ + --mode 2560x1600 \ + --pos 0x0 \ + --scale-from 1440x1280