Compare commits

...

162 Commits
main ... v0.1.1

Author SHA1 Message Date
Rob Muhlestein b3a3094ae8 fix: move loclist fix into main vim config 11 months ago
Rob Muhlestein b96b0a0d49 fix: shutup loclist when buffer closes 11 months ago
Rob Muhlestein 6d1a935da4 add .gitignore 11 months ago
Rob Muhlestein 39566dc2de add go module 11 months ago
Rob Muhlestein 911ff5b7b2 add initial files 11 months ago
Rob Muhlestein 3ce9e0cddb add install-kvm 11 months ago
Rob Muhlestein 4fe8d60f84 disable ugly gutter color 11 months ago
Rob Muhlestein 1e711b3ba5 change exteral lynx viewer to chrome 11 months ago
Rob Muhlestein 39191e5510 update install-podman 11 months ago
Rob Muhlestein c3c1aa55bd add install-podman 11 months ago
Rob Muhlestein 4ca90e4cd2 add google-chrome so in bin 11 months ago
Rob Muhlestein 1ebe66fe3b remove spotify completion, breaks mint 11 months ago
Rob Muhlestein 9303d83b0e fix ansi escapes in gpt 11 months ago
Rob Muhlestein 68c07f1fca reprioritize 11 months ago
Rob Muhlestein 1a4acb9e06 reprioritize ? ?? ??? 11 months ago
Rob Muhlestein 065711076e fix bug with token/key in gpt 11 months ago
Rob Muhlestein 57d8b11812 add gpt 11 months ago
Rob Muhlestein 7dbb608ceb add install-mods (for gpt/openai) 11 months ago
Rob Muhlestein 1a15a37058 add chatgpt command line query (gpt) 11 months ago
Rob Muhlestein 2feee2a8eb remove boostdates (use week and lastweek in skilstak instead) 11 months ago
Rob Muhlestein f16a017f13 fix: bork my initial prompt 11 months ago
Rob Muhlestein bf24b23c55 chore: add dancing 11 months ago
Rob Muhlestein c647f42bb9 chore: add glow and md 11 months ago
Rob Muhlestein 4b90c018b5 chore: move mdold 11 months ago
Rob Muhlestein 93ef16d0a1 chore: reorder .tmux.conf 11 months ago
Rob Muhlestein 80391caa89 fix: md 11 months ago
Rob Muhlestein d0fb8b0ab5 add bannerneo 11 months ago
Rob Muhlestein ac70c9b145 fix: install-neo 11 months ago
Rob Muhlestein 5759cca69d add ale with active go vet and linting 11 months ago
Rob Muhlestein 4462bb6c72 update klogin completion 11 months ago
Rob Muhlestein e72a7ec520 feat: add goreleaser completion 12 months ago
Rob Muhlestein 57c421081d fix: control-s/control-q as well 12 months ago
Rob Muhlestein f642a8e37d no need, use :.center instead 12 months ago
Rob Muhlestein e133de3e8a change back to use fishies 12 months ago
Rob Muhlestein e3b9113fac disable shfmt until it stops fucking up my saves 12 months ago
Rob Muhlestein 8b273c7c18 feat: add center 12 months ago
Rob Muhlestein e68876acd8 chore: add better comment to install-go 12 months ago
Rob Muhlestein 5a47c61e7c add zet pointing to keg 12 months ago
Rob Muhlestein 310bce8b81 feat: add shfmt on vim write to shell scripts 12 months ago
rwxrob fe42bc0ff7 Fix coworking script 12 months ago
rwxrob 3bea278f88 Add coworking command 12 months ago
rwxrob 40fe09bef1 Add alias, disable arrows in vim, fix kn/keg 12 months ago
rwxrob 3b8c7509c2 Add powerzones 1 year ago
rwxrob 0ad816bb2a Add powerzones stats and tz 1 year ago
rwxrob 927a189053 Remove dc (docker-compose) conflict with dc calc 1 year ago
rwxrob 3533e9632c Fix LANG typo, drop pcregrep 1 year ago
rwxrob e3b0573a42 Force en_US.UTF-8 locale 1 year ago
rwxrob b2a2e5511b Silence false "unsigned" cert errors 1 year ago
Rob Muhlestein 014509cda9
Add install-ngrok, examples, hnow modified 1 year ago
Rob Muhlestein 9a2d4a059b
Changed hnow to now be header 1 year ago
Rob Muhlestein 3e47f036e5
Add yoga toemoji 1 year ago
Rob Muhlestein 77b36509de
Add stuff 1 year ago
Rob Muhlestein b174b45b26
Remove zet function 2 years ago
Rob Muhlestein abcafec38f
Add pandoc/md mappings for gj/gk 2 years ago
Rob Muhlestein 47a4f40356
Move zet to a function so works from vim 2 years ago
Rob Muhlestein bc0b2e22f7
Better keg alias 2 years ago
Rob Muhlestein f829dc1a2a
Add angle brackets back to lynxa now that rendered 2 years ago
Rob Muhlestein a8e2134754
Add zet alias for keg 2 years ago
Rob Muhlestein 095790a8ad
Update README.md 2 years ago
Rob Muhlestein a32ba3a736
Add pylights 2 years ago
Rob Muhlestein b715b205e0
Add LESS back 2 years ago
Rob Muhlestein b7c634a713
Remove LESS since Z.Page does the right thing 2 years ago
Rob Muhlestein 00a61298ca
Move -R to LESS env var 2 years ago
Rob Muhlestein 65c75a037a
Add lorem 2 years ago
Rob Muhlestein d63d9c646d
Add kn as alias for keg 2 years ago
Rob Muhlestein db2b0eeed4
Add keg to completion 2 years ago
Rob Muhlestein 078fd39911
Add m to the front 2 years ago
Rob Muhlestein 9e4b0cf851
Move more alias to bashrc 2 years ago
Rob Muhlestein 8b2b83b240
Reactivate GPG_TTY 2 years ago
Rob Muhlestein 5eef74ee06 Make C-c for streaming mode 2 years ago
Rob Muhlestein 6430e51446 Stop line wrapping in pandoc/markdown files 2 years ago
Rob Muhlestein 67c77a7cb9 Improve goentrtest to take arguments 2 years ago
Rob Muhlestein 34af292b2c Disable ssh-agent stuff blocking startup 2 years ago
Rob Muhlestein 92952c14af Drop bashtop 2 years ago
Rob Muhlestein 8888b0f673 Add ip -c alias 2 years ago
Rob Muhlestein 2920fc7f0c Add (back) ssh-agent 2 years ago
Rob Muhlestein f507564997 Add bashentrtest 2 years ago
Rob Muhlestein 25e839ceb5 Add a bunch of random updates 2 years ago
Rob Muhlestein 8575e22bac Remove ansible (since in homelab) 2 years ago
Rob Muhlestein 05f402a2b1 Add install-etcd 2 years ago
Rob Muhlestein 4baf471968 Change htbtasks to start at 1 2 years ago
Rob Muhlestein 5084615ada Add updates to ansible inventory setup 2 years ago
Rob Muhlestein f79a0cb222 Drop ansible_ from hosts 2 years ago
Rob Muhlestein 4f5f198aef Remove angle brackets from lynxa cuz YouTube 2 years ago
Rob Muhlestein 31cd8c8356 Correct sh to bash 2 years ago
Rob Muhlestein 3de0bbbdcd Add goentr 2 years ago
Rob Muhlestein 9894adf2ea Add htbtasks 2 years ago
Rob Muhlestein b51a7d0b06 Fix mac completion dep in bashrc 2 years ago
Rob Muhlestein c6b19d0c1d Fix missing -f on path*pend functions 2 years ago
Rob Muhlestein bcefefe02c Add ssection 2 years ago
Rob Muhlestein 7b237b0257 Add path for go and java 2 years ago
Rob Muhlestein 35160bd7aa Add scentr for automatic entr shellcheck 2 years ago
Rob Muhlestein 78edaeabee Update MS Terminal settings 2 years ago
Rob Muhlestein 25b330babb Delete swagger installer based on old (v2) go-swagger 2 years ago
Rob Muhlestein 021c372c1b Add swagger completion 2 years ago
Rob Muhlestein 943fe5f91b Remove .DS_Store 2 years ago
Rob Muhlestein 187431462b Add .gitignore and remove .DS_Store 2 years ago
Rob Muhlestein c343a14d8e Add install-swagger script 2 years ago
rwxrob b7d8d72bbb Support rootless docker 2 years ago
rwxrob 9dcec1daec Install make as dep 2 years ago
rwxrob a103cfd636 Update to install 1.18 go by default 2 years ago
rwxrob 6d153fd11a Lose the go wrapper 2 years ago
rwxrob 04a5564606
Add OPA install-conftest 2 years ago
rwxrob f621e33a85
Add install-minikube 2 years ago
rwxrob 79cbeb1ef0
Add yaml 4 space indent, lose bad mod 2 years ago
rwxrob 845f748604
Remove old yq completion 2 years ago
rwxrob 1715fde39d
Add install-docker-compose 2 years ago
rwxrob 9605378d5f
Add latestghrel snippet 2 years ago
rwxrob 62b62da12e
Move isonan to bonzai z 2 years ago
rwxrob f5af959ee1
Disable spellcapcheck in vim 2 years ago
rwxrob 51c7f2bedc
Make new-from --public instead 2 years ago
rwxrob 2fd0641ae0
Add bonzai to tab completion 2 years ago
rwxrob f2851cf3e0
Update z completion 2 years ago
rwxrob 6e36ab3baf
Update cmds completion 2 years ago
rwxrob 1ac019664f
Add if err != nil, etc 2 years ago
rwxrob 8c3d094c50
Fix new-bonzai 2 years ago
rwxrob e00bcd96ed
Updates for commands 2 years ago
rwxrob 9b2c5dd4d8
Soften color for trailing space 2 years ago
rwxrob 24fbc80ad4
Add better vim visuals for scan.X work 2 years ago
rwxrob e963d2c812
Try vim without line numbers 2 years ago
rwxrob 8fb6c24296
Add sudo to install-kubectl 2 years ago
rwxrob 06b9a0665f
Add gologtestoutput 2 years ago
rwxrob c2a0b84a05
Add goimethods for interface->methods in vim 2 years ago
rwxrob b588d64fb4
Add isosec and -boost to marquee 2 years ago
rwxrob faef752606
Add underconstruction vim filter 2 years ago
rwxrob 540a0c76cf
Add gocopyright 2 years ago
rwxrob 8a75402557
Add String to goprintasstring 2 years ago
rwxrob 2e1b0015ea
Add more to goprintasjson 2 years ago
rwxrob d61ca296e2
Disable vim-polyglot, add pegn-pegn-syntax 2 years ago
rwxrob 76232e0cc9
Tweak tmux settings for more 81 cols 2 years ago
rwxrob 13fcefc5b9
Remove mistake scripts empty dir 2 years ago
rwxrob 57a598bdc6
Add entr to ubuntu install 2 years ago
rwxrob 9bc445fdd8
Add install-ansible 2 years ago
rwxrob bbac4593e9
Add foo and ./foo to completion in bashrc 2 years ago
rwxrob c0ed0894bb
Remove google chat spam 2 years ago
rwxrob 86e1f33de1
Add host script 2 years ago
rwxrob 5f7958c652
Add raid script 2 years ago
rwxrob a0fea92f1e
Use latest go build 2 years ago
rwxrob 97b56a17ab
Change htitle to go comments by default 2 years ago
rwxrob 7f6ccf61d5
Add goprintasjson 2 years ago
rwxrob fa2565ace4
Add fmttable 2 years ago
rwxrob 4e09c09a5a
Add 2 more spaces to fix gh issues 2 years ago
rwxrob 93ef87861f
Cleanup bashrc 2 years ago
rwxrob b8555619df
Add neo 2 years ago
rwxrob 7a3dcf8129
Fix location of pdfs 2 years ago
rwxrob 06582fa838
Drop wsl2 specific install stuff 2 years ago
rwxrob e81714d23a
Add more installation stuff 2 years ago
rwxrob 48248307c3
Add better dep checks to open script 2 years ago
rwxrob 4c62ce6b30
Add docker install 2 years ago
rwxrob 28d1ab2692
Add GOBIN to go script 2 years ago
rwxrob 403d6f5e9a
Add jq, pcregrep to install 2 years ago
rwxrob 6e51c56f88
Update install-go for 1.18 2 years ago
rwxrob 3828b6855a
Add anton script 2 years ago
rwxrob 0552b9b86f
Fix open script 2 years ago
rwxrob f06b53e5c5
Add mapleader="," and macro for go 2 years ago
rwxrob 766f99ac55
Add darker comments for Go to vim 2 years ago
rwxrob 4a12ddfd5c
Add script updates 2 years ago
Rob Muhlestein aeca3f6654 Fix quirks on mac 2 years ago
Rob Muhlestein 94b8e9b737 Add Mac and Windows support to open 2 years ago
Rob Muhlestein c5978faca7 Fix perl shebang 2 years ago
rwxrob ae8a71ebd2
Fix lynx 2 years ago
rwxrob 109a39f7a9
Fix lynx bug 2 years ago

@ -3,7 +3,7 @@
case $- in
*i*) ;; # interactive
*) return ;;
*) return ;;
esac
# ------------------------- distro detection -------------------------
@ -14,14 +14,19 @@ export DISTRO
# ---------------------- local utility functions ---------------------
_have() { type "$1" &>/dev/null; }
_have() { type "$1" &>/dev/null; }
_source_if() { [[ -r "$1" ]] && source "$1"; }
# ----------------------- environment variables ----------------------
# (also see envx)
export LANG=en_US.UTF-8 # assuming apt install language-pack-en done
export USER="${USER:-$(whoami)}"
export GITUSER="$USER"
export FTP=242
export WEIGHT=83.7
export HEIGHT=174
export TZ=America/New_York
export REPOS="$HOME/Repos"
export GHREPOS="$REPOS/github.com/$GITUSER"
export DOTFILES="$GHREPOS/dot"
@ -37,7 +42,7 @@ export PRIVATE="$HOME/Private"
export PICTURES="$HOME/Pictures"
export MUSIC="$HOME/Music"
export VIDEOS="$HOME/Videos"
export PDFS="$DOCUMENTS/PDFS"
export PDFS="$HOME/usb/pdfs"
export VIRTUALMACHINES="$HOME/VirtualMachines"
export WORKSPACES="$HOME/Workspaces" # container home dirs for mounting
export ZETDIR="$GHREPOS/zet"
@ -52,99 +57,111 @@ export EDITOR=vi
export VISUAL=vi
export EDITOR_PREFIX=vi
export GOPRIVATE="github.com/$GITUSER/*,gitlab.com/$GITUSER/*"
export GOPATH="$HOME/.local/share/go"
#export GOPATH="$HOME/.local/go"
export GOBIN="$HOME/.local/bin"
export GOPROXY=direct
export CGO_ENABLED=0
export PYTHONDONTWRITEBYTECODE=2 # fucking shit-for-brains var name
export PYTHONDONTWRITEBYTECODE=2
export LC_COLLATE=C
export CFLAGS="-Wall -Wextra -Werror -O0 -g -fsanitize=address -fno-omit-frame-pointer -finstrument-functions"
export LESS="-FXR"
export LESS_TERMCAP_mb="" # magenta
export LESS_TERMCAP_md="" # yellow
export LESS_TERMCAP_me="" # "0m"
export LESS_TERMCAP_se="" # "0m"
export LESS_TERMCAP_me="" # "0m"
export LESS_TERMCAP_se="" # "0m"
export LESS_TERMCAP_so="" # blue
export LESS_TERMCAP_ue="" # "0m"
export LESS_TERMCAP_ue="" # "0m"
export LESS_TERMCAP_us="" # underline
export ANSIBLE_INVENTORY="$HOME/.config/ansible/ansible_hosts"
export ANSIBLE_CONFIG="$HOME/.config/ansible/config.ini"
export ANSIBLE_INVENTORY="$HOME/.config/ansible/inventory.yaml"
export ANSIBLE_LOAD_CALLBACK_PLUGINS=1
#export ANSIBLE_STDOUT_CALLBACK=json
#export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock
[[ -d /.vim/spell ]] && export VIMSPELL=("$HOME/.vim/spell/*.add")
# -------------------------------- gpg -------------------------------
#export GPG_TTY=$(tty)
export GPG_TTY=$(tty)
# ------------------------------- pager ------------------------------
if [[ -x /usr/bin/lesspipe ]]; then
export LESSOPEN="| /usr/bin/lesspipe %s";
export LESSCLOSE="/usr/bin/lesspipe %s %s";
export LESSOPEN="| /usr/bin/lesspipe %s"
export LESSCLOSE="/usr/bin/lesspipe %s %s"
fi
# ----------------------------- dircolors ----------------------------
if _have dircolors; then
if [[ -r "$HOME/.dircolors" ]]; then
eval "$(dircolors -b "$HOME/.dircolors")"
else
eval "$(dircolors -b)"
fi
if [[ -r "$HOME/.dircolors" ]]; then
eval "$(dircolors -b "$HOME/.dircolors")"
else
eval "$(dircolors -b)"
fi
fi
# ------------------------------- path -------------------------------
pathappend() {
declare arg
for arg in "$@"; do
test -d "$arg" || continue
PATH=${PATH//":$arg:"/:}
PATH=${PATH/#"$arg:"/}
PATH=${PATH/%":$arg"/}
export PATH="${PATH:+"$PATH:"}$arg"
done
} && export pathappend
declare arg
for arg in "$@"; do
test -d "$arg" || continue
PATH=${PATH//":$arg:"/:}
PATH=${PATH/#"$arg:"/}
PATH=${PATH/%":$arg"/}
export PATH="${PATH:+"$PATH:"}$arg"
done
} && export -f pathappend
pathprepend() {
for arg in "$@"; do
test -d "$arg" || continue
PATH=${PATH//:"$arg:"/:}
PATH=${PATH/#"$arg:"/}
PATH=${PATH/%":$arg"/}
export PATH="$arg${PATH:+":${PATH}"}"
done
} && export pathprepend
for arg in "$@"; do
test -d "$arg" || continue
PATH=${PATH//:"$arg:"/:}
PATH=${PATH/#"$arg:"/}
PATH=${PATH/%":$arg"/}
export PATH="$arg${PATH:+":${PATH}"}"
done
} && export -f pathprepend
# remember last arg will be first in path
pathprepend \
/usr/local/bin \
/usr/local/*/bin \
"$HOME/.local/bin" \
"$GHREPOS/cmd-"* \
"$SCRIPTS"
"$HOME/.local/bin" \
"$HOME/.local/go/bin" \
"$HOME/.nimble/bin" \
"$GHREPOS/cmd-"* \
/usr/local/go/bin \
/usr/local/opt/openjdk/bin \
/usr/local/bin \
"$SCRIPTS"
pathappend \
/usr/local/opt/coreutils/libexec/gnubin \
'/mnt/c/Program Files/Oracle/VirtualBox' \
'/mnt/c/Windows' \
'/mnt/c/Program Files (x86)/VMware/VMware Workstation' \
/mingw64/bin \
/usr/local/bin \
/usr/local/sbin \
/usr/local/games \
/usr/games \
/usr/sbin \
/usr/bin \
/snap/bin \
/sbin \
/bin
/usr/local/opt/coreutils/libexec/gnubin \
'/mnt/c/Windows' \
'/mnt/c/Program Files (x86)/VMware/VMware Workstation' \
/mingw64/bin \
/usr/local/bin \
/usr/local/sbin \
/usr/local/games \
/usr/games \
/usr/sbin \
/usr/bin \
/snap/bin \
/sbin \
/bin
# ------------------------------ cdpath ------------------------------
export CDPATH=".:$GHREPOS:$DOT:$REPOS:/media/$USER:$HOME"
export CDPATH=".:$GHREPOS:$DOTFILES:$REPOS:/media/$USER:$HOME"
# ------------------------ bash shell options ------------------------
shopt -s checkwinsize
# shopt is for BASHOPTS, set is for SHELLOPTS
shopt -s checkwinsize # enables $COLUMNS and $ROWS
shopt -s expand_aliases
shopt -s globstar
shopt -s dotglob
@ -153,6 +170,11 @@ shopt -s extglob
#shopt -s nullglob # bug kills completion for some
#set -o noclobber
# -------------------------- stty annoyances -------------------------
#stty stop undef # disable control-s accidental terminal stops
stty -ixon # disable control-s/control-q tty flow control
# ------------------------------ history -----------------------------
export HISTCONTROL=ignoreboth
@ -170,177 +192,183 @@ PROMPT_MAX=95
PROMPT_AT=@
__ps1() {
local P='$' dir="${PWD##*/}" B countme short long double\
r='\[\e[31m\]' g='\[\e[30m\]' h='\[\e[34m\]' \
u='\[\e[33m\]' p='\[\e[34m\]' w='\[\e[35m\]' \
b='\[\e[36m\]' x='\[\e[0m\]'
[[ $EUID == 0 ]] && P='#' && u=$r && p=$u # root
[[ $PWD = / ]] && dir=/
[[ $PWD = "$HOME" ]] && dir='~'
B=$(git branch --show-current 2>/dev/null)
[[ $dir = "$B" ]] && B=.
countme="$USER$PROMPT_AT$(hostname):$dir($B)\$ "
[[ $B = master || $B = main ]] && b="$r"
[[ -n "$B" ]] && B="$g($b$B$g)"
short="$u\u$g$PROMPT_AT$h\h$g:$w$dir$B$p$P$x "
long="${g}$u\u$g$PROMPT_AT$h\h$g:$w$dir$B\n${g}$p$P$x "
double="$g$u\u$g$PROMPT_AT$h\h$g:$w$dir\n$g$B\n$g$p$P$x "
if (( ${#countme} > PROMPT_MAX )); then
PS1="$double"
elif (( ${#countme} > PROMPT_LONG )); then
PS1="$long"
else
PS1="$short"
fi
local P='$' dir="${PWD##*/}" B countme short long double \
r='\[\e[31m\]' g='\[\e[30m\]' h='\[\e[34m\]' \
u='\[\e[33m\]' p='\[\e[34m\]' w='\[\e[35m\]' \
b='\[\e[36m\]' x='\[\e[0m\]'
[[ $EUID == 0 ]] && P='#' && u=$r && p=$u # root
[[ $PWD = / ]] && dir=/
[[ $PWD = "$HOME" ]] && dir='~'
B=$(git branch --show-current 2>/dev/null)
[[ $dir = "$B" ]] && B=.
countme="$USER$PROMPT_AT$(hostname):$dir($B)\$ "
[[ $B == master || $B == main ]] && b="$r"
[[ -n "$B" ]] && B="$g($b$B$g)"
short="$u\u$g$PROMPT_AT$h\h$g:$w$dir$B$p$P$x "
long="$g$u\u$g$PROMPT_AT$h\h$g:$w$dir$B\n$g$p$P$x "
double="$g$u\u$g$PROMPT_AT$h\h$g:$w$dir\n$g$B\n$g$p$P$x "
if ((${#countme} > PROMPT_MAX)); then
PS1="$double"
elif ((${#countme} > PROMPT_LONG)); then
PS1="$long"
else
PS1="$short"
fi
}
PROMPT_COMMAND="__ps1"
# ----------------------------- keyboard -----------------------------
_have setxkbmap && test -n "$DISPLAY" && \
setxkbmap -option caps:escape &>/dev/null
# only works if you have X and are using graphic Linux desktop
_have setxkbmap && test -n "$DISPLAY" &&
setxkbmap -option caps:escape &>/dev/null
# ------------------------------ aliases -----------------------------
# (use exec scripts instead, which work from vim and subprocs)
unalias -a
alias ip='ip -c'
alias '?'=duck
alias '??'=google
alias '???'=bing
alias '??'=gpt
alias '???'=google
alias dot='cd $DOTFILES'
alias scripts='cd $SCRIPTS'
alias snippets='cd $SNIPPETS'
alias ls='ls -h --color=auto'
alias free='free -h'
alias tree='tree -a'
alias df='df -h'
alias chmox='chmod +x'
alias diff='diff --color'
alias sshh='sshpass -f $HOME/.sshpass ssh '
alias temp='cd $(mktemp -d)'
alias view='vi -R' # which is usually linked to vim
alias c='printf "\e[H\e[2J"'
alias clear='printf "\e[H\e[2J"'
alias c='printf "\e[H\e[2J"'
alias coin="clip '(yes|no)'"
alias grep="grep -P"
alias minidockenv=". <(minikube docker-env)"
alias top=bashtop
alias iam=live
alias neo="neo -D -c gold"
alias more="less"
alias disclaimer="clear; now; zet view disclaimer"
_have vim && alias vi=vim
# ----------------------------- functions ----------------------------
# lesscoloroff() {
# while IFS= read -r line; do
# unset ${line%%=*}
# done < <(env | grep LESS_TERM)
# } && export -f lesscoloroff
envx() {
local envfile="${1:-"$HOME/.env"}"
[[ ! -e "$envfile" ]] && echo "$envfile not found" && return 1
while IFS= read -r line; do
name=${line%%=*}
value=${line#*=}
[[ -z "${name}" || $name =~ ^# ]] && continue
export "$name"="$value"
done < "$envfile"
local envfile="${1:-"$HOME/.env"}"
[[ ! -e "$envfile" ]] && echo "$envfile not found" && return 1
while IFS= read -r line; do
name=${line%%=*}
value=${line#*=}
[[ -z "${name}" || $name =~ ^# ]] && continue
export "$name"="$value"
done <"$envfile"
} && export -f envx
[[ -e "$HOME/.env" ]] && envx "$HOME/.env"
new-from() {
local template="$1"
local name="$2"
! _have gh && echo "gh command not found" && return 1
[[ -z "$name" ]] && echo "usage: $0 <name>" && return 1
[[ -z "$GHREPOS" ]] && echo "GHREPOS not set" && return 1
[[ ! -d "$GHREPOS" ]] && echo "Not found: $GHREPOS" && return 1
cd "$GHREPOS" || return 1
[[ -e "$name" ]] && echo "exists: $name" && return 1
gh repo create -p "$template" "$name"
cd "$name" || return 1
new-from() {
local template="$1"
local name="$2"
! _have gh && echo "gh command not found" && return 1
[[ -z "$name" ]] && echo "usage: $0 <name>" && return 1
[[ -z "$GHREPOS" ]] && echo "GHREPOS not set" && return 1
[[ ! -d "$GHREPOS" ]] && echo "Not found: $GHREPOS" && return 1
cd "$GHREPOS" || return 1
[[ -e "$name" ]] && echo "exists: $name" && return 1
gh repo create -p "$template" --public "$name"
gh repo clone "$name"
cd "$name" || return 1
}
new-cmdbox() { new-from rwxrob/template-cmdbox "cmdbox-$1"; }
new-bonzai() { new-from rwxrob/bonzai-example "$1"; }
new-cmd() { new-from rwxrob/template-bash-command "cmd-$1"; }
cdz () { cd $(zet get "$@"); }
cdz() { cd $(zet get "$@"); }
export -f new-from new-cmdbox new-cmd
export -f new-from new-bonzai new-cmd
clone() {
local repo="$1" user
local repo="${repo#https://github.com/}"
local repo="${repo#git@github.com:}"
if [[ $repo =~ / ]]; then
user="${repo%%/*}"
else
user="$GITUSER"
[[ -z "$user" ]] && user="$USER"
fi
local name="${repo##*/}"
local userd="$REPOS/github.com/$user"
local path="$userd/$name"
[[ -d "$path" ]] && cd "$path" && return
mkdir -p "$userd"
cd "$userd"
echo gh repo clone "$user/$name" -- --recurse-submodule
gh repo clone "$user/$name" -- --recurse-submodule
cd "$name"
local repo="$1" user
local repo="${repo#https://github.com/}"
local repo="${repo#git@github.com:}"
if [[ $repo =~ / ]]; then
user="${repo%%/*}"
else
user="$GITUSER"
[[ -z "$user" ]] && user="$USER"
fi
local name="${repo##*/}"
local userd="$REPOS/github.com/$user"
local path="$userd/$name"
[[ -d "$path" ]] && cd "$path" && return
mkdir -p "$userd"
cd "$userd"
echo gh repo clone "$user/$name" -- --recurse-submodule
gh repo clone "$user/$name" -- --recurse-submodule
cd "$name"
} && export -f clone
# ------------- source external dependencies / completion ------------
# for mac
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
owncomp=(
pdf md zet yt gl auth pomo config live iam sshkey ws x clip
./build build b ./k8sapp k8sapp ./setup ./cmd run ./run
pdf zet keg kn yt gl auth pomo config live iam sshkey ws x z clip
./build build b ./k8sapp k8sapp ./setup ./cmd run ./run
foo ./foo cmds ./cmds z bonzai openapi
)
for i in "${owncomp[@]}"; do complete -C "$i" "$i"; done
_have gh && . <(gh completion -s bash)
_have glow && . <(glow completion bash)
_have goreleaser && . <(goreleaser completion bash 2>/dev/null)
_have klogin && . <(klogin completion bash 2>/dev/null)
_have pandoc && . <(pandoc --bash-completion)
_have kubectl && . <(kubectl completion bash 2>/dev/null)
_have spotify && . <(spotify completion bash 2>/dev/null)
#_have clusterctl && . <(clusterctl completion bash)
_have k && complete -o default -F __start_kubectl k
_have kind && . <(kind completion bash)
_have kompose && . <(kompose completion bash)
_have yq && . <(yq shell-completion bash)
_have helm && . <(helm completion bash)
_have minikube && . <(minikube completion bash)
_have conftest && . <(conftest completion bash)
_have mk && complete -o default -F __start_minikube mk
_have podman && _source_if "$HOME/.local/share/podman/completion" # d
_have docker && _source_if "$HOME/.local/share/docker/completion" # d
_have docker-compose && complete -F _docker_compose dc # dc
_have docker-compose && complete -F _docker_compose dc # dc
_have ansible && . <(register-python-argcomplete3 ansible)
_have ansible-config && . <(register-python-argcomplete3 ansible-config)
_have ansible-console && . <(register-python-argcomplete3 ansible-console)
_have ansible-doc && . <(register-python-argcomplete3 ansible-doc)
_have ansible-galaxy && . <(register-python-argcomplete3 ansible-galaxy)
_have ansible-inventory && . <(register-python-argcomplete3 ansible-inventory)
_have ansible-playbook && . <(register-python-argcomplete3 ansible-playbook)
_have ansible-pull && . <(register-python-argcomplete3 ansible-pull)
_have ansible-vault && . <(register-python-argcomplete3 ansible-vault)
#_have ssh-agent && test -z "$SSH_AGENT_PID" && . <(ssh-agent)
# -------------------- personalized configuration --------------------
_source_if "$HOME/.bash_personal"
_source_if "$HOME/.bash_private"
_source_if "$HOME/.bash_work"
complete -C /usr/bin/terraform terraform
complete -C /usr/bin/terraform tf
# only use this if you really want libvirt (virtualbox does not need)
# vagrant(){
# docker run -it --rm \
# -e LIBVIRT_DEFAULT_URI \
# -v /var/run/libvirt/:/var/run/libvirt/ \
# -v ~/.vagrant.d:/.vagrant.d \
# -v $(realpath "${PWD}"):${PWD} \
# -w $(realpath "${PWD}") \
# --network host \
# vagrantlibvirt/vagrant-libvirt:latest \
# vagrant $@
# } && export -f vagrant
if _have vagrant; then
export VAGRANT_EXPERIMENTAL="disks"
# >>>> Vagrant command completion (start)
. /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/contrib/bash/completion.sh
# <<<< Vagrant command completion (end)
complete -F _vagrant v
fi
export DISPLAY=:0.0 #GWSL
export PULSE_SERVER=tcp:localhost #GWSL
_have terraform && complete -C /usr/bin/terraform terraform
_have terraform && complete -C /usr/bin/terraform tf

1
.gitignore vendored

@ -0,0 +1 @@
.DS_Store

@ -1,4 +1,5 @@
# particularly useful for psql
set editing-mode vi
set enable-bracketed-paste on
#set bell-style none # MAKE IT STOP!!
set keymap vi

@ -1,28 +1,7 @@
# Personal Dotfiles and Scripts
Pilfer at your own peril. Mention <https://rwxrob.tv> if you do. Stop by
and chat sometime.
Pilfer at your own peril. Mention rwxrob.tv if you do. Stop by and chat sometime.
## Installation
Be aware that most of what is in `scripts` is being (slowly) ported into my [`z` stateful command tree monolith utility](https://github.com/rwxrob/z). I'm even going to bundle my `.vimrc` and `.bashrc` files as embedded so I can setup my environment with a single command, anywhere.
For installation information and sampling see the [workspace container]
that depends on this repo.
Also see the [scripts `README.md` Installation][scripts] as well.
[workspace container]: <https://github.com/rwxrob/workspace>
[scripts]: scripts/#installation
## More Information
For questions about design decisions and setup consider my [zet notes]
and [streaming faq].
[zet notes]: <https://github.com/rwxrob/zet>
[streaming faq]: <https://github.com/rwxrob/faq>
## Legal
Copyright 2021 Rob Muhlestein <rob@rwx.gg>
Released under Apache-1.0 License
Please mention <https://rwxrob.tv>
For questions about design decisions and setup consider my [zet notes](https://github.com/rwxrob/zet).

@ -1,6 +0,0 @@
# My Ansible Stuff
> ⚠️
> A lot of this is duplicated in the installer files (for now) until
> I can migrate it all over.

@ -5,13 +5,13 @@ pager: less
aliases:
co: pr checkout
del: |
!gh api -X DELETE "repos/$GITUSER/$1"
!gh api -X DELETE "repos/$GITUSER/$1"
priv: |
!gh api -X PATCH "repos/$GITUSER/$1" -f private="true" | jq .private
!gh api -X PATCH "repos/$GITUSER/$1" -f private="true" | jq .private
pub: |
!gh api -X PATCH "repos/$GITUSER/$1" -f private="false" | jq .private
!gh api -X PATCH "repos/$GITUSER/$1" -f private="false" | jq .private
status: |
!gh api graphql -f emoji="${1%% *}" -f msg="${1#* }" -f query='mutation ($msg: String!, $emoji: String) {changeUserStatus(input:{message:$msg,emoji:$emoji}) {status { message, emoji }}}'
!gh api graphql -f emoji="${1%% *}" -f msg="${1#* }" -f query='mutation ($msg: String!, $emoji: String) {changeUserStatus(input:{message:$msg,emoji:$emoji}) {status { message, emoji }}}'
repos: |
!gh api --paginate graphql -f owner="$1" -f query='
query($owner: String!, $per_page: Int = 100, $endCursor: String) {
@ -38,4 +38,4 @@ aliases:
}
} ' | jq -r '.data.viewer.organizations[][] | .id + " " + .name'
defmain: |
!gh api -X PATCH "repos/$1" -f default_branch="main" | jq .default_branch
!gh api -X PATCH "repos/$1" -f default_branch="main" | jq .default_branch

@ -0,0 +1,22 @@
module github.com/rwxrob/dot
go 1.18
require (
github.com/rwxrob/bonzai v0.20.10
github.com/rwxrob/choose v0.2.1
github.com/rwxrob/fs v0.20.2
)
require (
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rwxrob/compcmd v0.3.0 // indirect
github.com/rwxrob/fn v0.4.0 // indirect
github.com/rwxrob/pegn v0.2.1 // indirect
github.com/rwxrob/structs v0.6.0 // indirect
github.com/rwxrob/term v0.2.9 // indirect
github.com/rwxrob/to v0.12.1 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
)

@ -0,0 +1,26 @@
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rwxrob/bonzai v0.20.10 h1:MC77uTOENkQA2Zt/r98teSgP/bHuGw04s5k1ECAKgq0=
github.com/rwxrob/bonzai v0.20.10/go.mod h1:QmLf6NXoVtTf3pY7eYR4+k9daz2bdRiiq5ArFckAW3E=
github.com/rwxrob/choose v0.2.1 h1:iuN6NkiOwER6QpSzEVTTp+ZOb33PGFIC3Y1OK6D6Quc=
github.com/rwxrob/choose v0.2.1/go.mod h1:mhuV7pY/62p1sZCvCGVET5GuF+Z126hKxqnzSUOO0EU=
github.com/rwxrob/compcmd v0.3.0 h1:AlJNItb7+Yk17qmH5E7TJFyBXhna/rS3NeQAgjqbFls=
github.com/rwxrob/compcmd v0.3.0/go.mod h1:XOHl6bS2Uen6Wx2mxtbtUhT8Sbz1IhnaE55xPkhTBD4=
github.com/rwxrob/fn v0.4.0 h1:lUZEkELSFAlPhzrkNhgB/xoTkz9tv5op4g0QfggSZFg=
github.com/rwxrob/fn v0.4.0/go.mod h1:omPqOqEB+dDna09z5pi5YFxq4IZqDvv3wFPUCES5LvY=
github.com/rwxrob/fs v0.20.2 h1:TYUgr7wZYhyMgCINygQOa4Cf1zJahZ8qmZX1KsIJyH4=
github.com/rwxrob/fs v0.20.2/go.mod h1:iSQeNjy6YY1UCfL0LBwzKH6qZLRnVG9InZYvMnJX8wA=
github.com/rwxrob/pegn v0.2.1 h1:roE+SkNl66SLJkeEHowuds+0lUOjSlTHE8IDJuZZUNs=
github.com/rwxrob/pegn v0.2.1/go.mod h1:TyD3XS8ddVucs2gwMr1VhB2HbHiruzj6Ub67RZGTfMA=
github.com/rwxrob/structs v0.6.0 h1:t8JVd/Pee1OGaXgT6QYmGed470C9vOw6scdH8Cr5LPg=
github.com/rwxrob/structs v0.6.0/go.mod h1:txMfzPfEiIDNM5bwhzUqxr/1QQ3ekOuj3KLT8Nt1fA0=
github.com/rwxrob/term v0.2.9 h1:lXcrmKMbMQ5Etfm+tjAbHsx2v2yHnZSvzOfS/LGDBXc=
github.com/rwxrob/term v0.2.9/go.mod h1:ptzymk+QUaT54SiRzh6ITMW65qGsJDAdSZIysq17iO8=
github.com/rwxrob/to v0.12.1 h1:2x1SgNK2ixE7FhbDFK2fzlx3Y3qPIBcSFm/jivUzOQM=
github.com/rwxrob/to v0.12.1/go.mod h1:8+uSoxMWfTSY/KU57db87hWGZGsiVW0uSDZd7NAgInI=
golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c=
golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=

@ -0,0 +1,3 @@
go 1.18
use .

@ -0,0 +1,2 @@
#!/bin/bash
sudo gem install twurl

@ -1,6 +1,6 @@
#!/bin/bash
#!/bin/sh
sudo add-apt-repository --yes --update ppa:ansible/ansible
🐧🏡 Linux Homelab Init - Install CRI-O with Ansible from debs`sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible
sudo apt install python3-argcomplete
sudo activate-global-python-argcomplete3

@ -0,0 +1,5 @@
#!/bin/sh
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
user="open-policy-agent"
repo="conftest"
os=$(uname -s)
arch=$(uname -m)
latest=$(curl -sSL "https://api.github.com/repos/$user/$repo/releases/latest" | jq -r .name)
rel="https://github.com/$user/$repo/releases/download/$latest/${repo}_${latest//v/}_${os^}_${arch}.tar.gz"
dir=$(mktemp -d)
curl -sSL "$rel" -o "$dir/$repo.tar.gz"
cd "$dir"
tar xzf "$repo.tar.gz"
mv "$dir/$repo" "$HOME/.local/bin"
rm -rf "$dir"

@ -0,0 +1,5 @@
#!/bin/sh
clone docker/docker-install
./install.sh
dockerd-rootless-setuptool.sh install

@ -0,0 +1,10 @@
#!/bin/bash
user="docker"
repo="compose"
os=$(uname -s)
arch=$(uname -m)
latest=$(curl -sSL "https://api.github.com/repos/$user/$repo/releases/latest" | jq -r .name)
rel="https://github.com/docker/compose/releases/download/$latest/docker-compose-${os,,}-$arch"
curl -sSL "$rel" -o "$HOME/.local/bin/docker-compose"
chmod +x "$HOME/.local/bin/docker-compose"

@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -e
echo "Are you absolutely sure you want to install the *latest* etcd"
echo "(which may not be the same as the one for your Kubernetes version)."
read -p "(y/N) " response
test "$response" = "y"
user="etcd-io"
repo="etcd"
os=$(uname -s)
arch=$(uname -m)
[[ "$arch" == x86_64 ]] && arch=amd64
latest=$(curl -sSL "https://api.github.com/repos/$user/$repo/releases/latest" | jq -r .name)
rel="https://github.com/$user/$repo/releases/download/$latest/${repo}-${latest}-${os,,}-${arch}.tar.gz"
dir=$(mktemp -d)
curl -L "$rel" -o "$dir/$repo.tar.gz"
cd "$dir"
tar xzf "$repo.tar.gz"
echo "Do you want to move the following into /usr/local/bin?"
ls -l $repo-$latest*/etcd*
read -p "(y/N) " response
test "$response" = "y"
sudo mv $repo-$latest*/etcd* /usr/local/bin
rm -rf "$dir"

@ -1,22 +1,52 @@
#!/bin/sh
set -e
#!/usr/bin/env bash
cd "$(mktemp -d)"
# Installs the latest Go release into $TARGETDIR (default: ~/.local)
# without requiring root access. Assumes the following suggested
# environment variables (which need to be set or changed in this script
# or after install completes):
#
# PATH="~/.local/bin:~/.local/bin/go/bin:$PATH"
# GOOS=linux
# GOARCH=amd64
# GOPATH="~/.local/go"
# GOBIN="~/.local/go/bin"
#
# Note that the downloaded tar file is not removed and can be found in
# either $DOWNLOADS or /tmp.
# TODO eventually update this to detect
os=mac
arch=amd64
true "${TARGETDIR:="$HOME/.local"}"
file=$(curl -sSL "https://golang.org/dl/?mode=json" \
| jq -r '.[0].files[]
| select(.os == "'"$os"'")
| select(.arch == "'"$arch"'")
| .filename')
# change this to your target (detecting not always reliable)
declare GOOS=linux
declare GOARCH=amd64
curl -sSLO \
-H "Accept: application/vnd.github.v3+json" \
"https://dl.google.com/go/$file"
lookup_file() {
curl -sSL "https://go.dev/dl/?mode=json" |
jq -r '.[0].files[]
| select(.os == "'"$GOOS"'")
| select(.arch == "'"$GOARCH"'")
| .filename'
}
sudo tar xzf "$file" -C /usr/local/
fetch() {
local filename
filename="$(lookup_file)"
[[ -z "$filename" ]] && echo "unable to fetch filename" 1>&2 && return 1
local path="/tmp/$filename"
[[ -n "$DOWNLOADS" ]] && [[ -d "$DOWNLOADS" ]] && path="$DOWNLOADS/$filename"
curl -L "https://go.dev/dl/$filename" -o "$path"
echo "$path"
}
echo "Make sure /usr/local/go/bin is in PATH"
install_latest_go() {
local dir="$1" path
[[ -z "$dir" ]] && dir="$TARGETDIR"
[[ -z "$dir" ]] && dir="$HOME/.local"
mkdir -p "$dir" 2>/dev/null
path="$(fetch)"
[[ -z "$path" ]] && echo "unable to fetch go tarball" 1>&2 && return 1
rm -rf "$dir/go" && tar -C "$dir" -xzf "$path" # rm is required by instructions
echo "Add $dir/go/bin to your path and optionally set GOBIN=~/.local/bin" 1>&2
}
install_latest_go

@ -4,4 +4,5 @@ V=$(curl -L -s https://dl.k8s.io/release/stable.txt)
curl -sSLO "https://dl.k8s.io/release/${V}/bin/linux/amd64/kubectl"
curl -sSLO "https://dl.k8s.io/${V}/bin/linux/amd64/kubectl.sha256"
echo "$(head -1 kubectl.sha256) kubectl" | sha256sum --check
cp kubectl /usr/bin && chmod +x /usr/bin/kubectl
sudo mv kubectl /usr/bin && sudo chmod +x /usr/bin/kubectl
rm kubectl.sha256

@ -0,0 +1,3 @@
#!/bin/sh
sudo apt update
sudo apt install qemu-kvm bridge-utils virt-manager libosinfo-bin -y

@ -0,0 +1,8 @@
#!/usr/bin/bash
curl -Lo minikube \
https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& chmod +x minikube
sudo mkdir -p /usr/local/bin/
sudo install minikube /usr/local/bin/

@ -0,0 +1,20 @@
#!/bin/sh
set -e
user=charmbracelet
repo=mods
arch=$(uname -m)
[ "$arch" = x86_64 ] && arch=amd64
latest="https://api.github.com/repos/$user/$repo/releases/latest"
ver=$(curl -sS "$latest" | jq -r .zipball_url) && test -n "$ver"
ver=${ver##*/}
ver=${ver#v}
deb="${repo}_${ver}_${arch}.deb"
url="https://github.com/$user/$repo/releases/download/v${ver}/$deb"
dir="$(mktemp -d)"
echo "$dir"
cd "$dir"
curl -LO "$url" && sudo dpkg -i ./*.deb

@ -1,3 +1,4 @@
#!/bin/sh
sudo apt install nmap
sudo apt install nmap jq pcregrep lynx make uidmap ruby weechat-curses python-is-python3 libcurses-perl figlet cmatrix build-essential libncurses-dev autoconf entr
sudo cpan -I Term::Animation

@ -0,0 +1,18 @@
#!/bin/sh
sudo apt install autoconf
sudo apt install build-essentials
sudo apt install ncurses-base
sudo apt-get install libncurses5-dev
[ -z "$(command -v gh)" ] && echo "gh required" && exit
[ -z "$(command -v make)" ] && echo "make required (build-essentials)" && exit
[ -z "$(command -v autoconf)" ] && echo "autoconf required" && exit
dir="$REPOS/github.com/st3w/neo"
mkdir -p "$(basename "$dir")"
if [ ! -d "$dir" ]; then
gh repo clone st3w/neo "$dir"
fi
cd "$dir"
./autogen.sh
./configure
make
sudo make install

@ -0,0 +1,6 @@
#!/bin/bash
set -x
curl -SsLO "https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz"
mkdir -p ~/.local/bin
tar zxvf ngrok-v3-stable-linux-amd64.tgz -C ~/.local/bin

@ -6,4 +6,4 @@ loc=$(curl -o /dev/null -sIw "%{redirect_url}" \
deb="pandoc-$vers-1-amd64.deb"
uri=${loc%/tag*}/download/$vers/$deb
curl -sL "$uri" -o "/tmp/$deb"
dpkg -i "/tmp/$deb"
sudo dpkg -i "/tmp/$deb"

@ -0,0 +1,8 @@
#!/bin/sh
sudo apt-get install -y podman
sudo wget https://github.com/containers/gvisor-tap-vsock/releases/download/v0.6.2/gvproxy-linux \
-O /usr/libexec/podman/gvproxy \
&& sudo chmod +x /usr/libexec/podman/gvproxy
sudo chmod 4755 /usr/bin/newgidmap
sudo chmod 4755 /usr/bin/newuidmap

@ -1,9 +0,0 @@
#!/bin/bash
# WARNING: this will fuck up your terminal and overwrite stuff, be
# careful
curl https://download.opensuse.org/repositories/isv:/Rancher:/stable/deb/Release.key | sudo apt-key add -
sudo add-apt-repository 'deb https://download.opensuse.org/repositories/isv:/Rancher:/stable/deb/ ./'
sudo apt update
sudo apt install rancher-desktop

@ -1,25 +1,26 @@
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
"actions":
[
{
"command":
"command": "paste",
"keys": "ctrl+v"
},
{
"command":
{
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
},
{
"command": "paste",
"keys": "ctrl+v"
},
{
"command": "find",
"keys": "ctrl+shift+f"
},
{
"command":
"command":
{
"action": "splitPane",
"split": "auto",
@ -28,60 +29,48 @@
"keys": "alt+shift+d"
}
],
"alwaysShowTabs": true,
"copyFormatting": "none",
"copyOnSelect": true,
"defaultProfile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
"disableAnimations": true,
"initialCols": 80,
"launchMode": "default",
"profiles":
"copyOnSelect": false,
"defaultProfile": "{e6f59385-ccc8-4b92-af9e-70e357bd54a8}",
"launchMode": "fullscreen",
"profiles":
{
"defaults": {},
"list":
"defaults":
{
"bellStyle": "none",
"closeOnExit": "always",
"colorScheme": "Gruvbox",
"cursorShape": "filledBox",
"font":
{
"face": "Ubuntu Mono",
"size": 28,
"weight": "normal"
},
"scrollbarState": "hidden",
"startingDirectory": "%USERPROFILE%",
"useAcrylic": false
},
"list":
[
{
"commandline": "powershell.exe",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"name": "Windows PowerShell"
},
{
"bellStyle": "none",
"closeOnExit": "always",
"colorScheme": "Gruvbox",
"commandline": "C:\\Program Files\\Git\\bin\\bash.exe",
"fontFace": "UbuntuMono NF",
"fontSize": 21,
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"name": "Git-Bash",
"padding": "4",
"scrollbarState": "hidden"
"name": "Command Prompt"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"bellStyle": "none",
"closeOnExit": "always",
"colorScheme": "Gruvbox",
"fontFace": "UbuntuMono NF",
"fontSize": 21,
"guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
"hidden": false,
"name": "Ubuntu-20.04",
"padding": "5",
"scrollbarState": "hidden",
"source": "Windows.Terminal.Wsl",
"startingDirectory": "%USERPROFILE%"
"commandline": "C:\\Program Files\\Git\\bin\\bash.exe",
"guid": "{e6f59385-ccc8-4b92-af9e-70e357bd54a8}",
"name": "git-bash"
}
]
},
"schemes":
"schemes":
[
{
"background": "#0C0C0C",
@ -130,7 +119,7 @@
"yellow": "#C19C00"
},
{
"background": "#282828",
"background": "#1A1A1A",
"black": "#504945",
"blue": "#458588",
"brightBlack": "#928374",
@ -140,7 +129,7 @@
"brightPurple": "#D3869B",
"brightRed": "#FB4934",
"brightWhite": "#EBDBB2",
"brightYellow": "#FABD2F",
"brightYellow": "#DABD2F",
"cursorColor": "#EBDBB2",
"cyan": "#689D6A",
"foreground": "#EBDBB2",
@ -314,8 +303,5 @@
"yellow": "#808000"
}
],
"showTabsInTitlebar": true,
"showTerminalTitleInTitlebar": false,
"startOnUserLogin": true,
"theme": "dark"
"startOnUserLogin": true
}

@ -1,4 +0,0 @@
# Linux Supersystem for Windows (WSL2)
This is for specific stuff for WSL2 that is not already covered by
Ubuntu.

@ -0,0 +1 @@
getlynx

@ -0,0 +1,6 @@
# Get `lynx` and setup from SKILSTAK Beginner Boost
## Repo considerations
Note that the `lynx`, `lynx.lss` and `lynx.cfg` are UNIX hard links and may not appear as such in clones.

@ -0,0 +1,71 @@
package main
import (
_ "embed"
"fmt"
"os"
"path/filepath"
Z "github.com/rwxrob/bonzai/z"
"github.com/rwxrob/choose"
"github.com/rwxrob/fs/dir"
"github.com/rwxrob/fs/file"
)
//go:embed lynx.lss
var lss string // styles and colors that go with gruvbox terminal theme
//go:embed lynx.cfg
var cfg string // vim-based configurations for lynx
//go:embed lynx
var lynx string // handles environment variable setup but still finds lynx binary
var Cmd = &Z.Cmd{
Call: func(_ *Z.Cmd, _ ...string) error {
// create ~/.config/lynx if not exists
confdir, err := os.UserConfigDir()
if err != nil {
return err
}
target := filepath.Join(confdir, `lynx`)
if !dir.Exists(target) {
err := dir.Create(target)
if err != nil {
return err
}
}
// write the lss and cfg files to dir
cfgpath := filepath.Join(target, `lynx.cfg`)
if err := file.Overwrite(cfgpath, cfg); err != nil {
return err
}
fmt.Printf("lynx.cfg written to %v\n", cfgpath)
lsspath := filepath.Join(target, `lynx.lss`)
if err := file.Overwrite(lsspath, lss); err != nil {
return err
}
fmt.Printf("lynx.lss written to %v\n", lsspath)
// copy the lynx script to the path location specified
path := filepath.SplitList(os.Getenv(`PATH`))
fmt.Println(`Which path should we put the binaries in? (You must have access.)`)
_, target, err = choose.From(path)
if err != nil {
return err
}
lynxpath := filepath.Join(target, `lynx`)
if err := file.Overwrite(lynxpath, lynx); err != nil {
return err
}
fmt.Printf("lynx written to %v\n", lynxpath)
err = os.Chmod(lynxpath, 0700)
if err != nil {
return err
}
return nil
},
}

@ -0,0 +1,26 @@
#!/usr/bin/env bash
# be sure to install the ca-certificates package
# see ../lynx/README.md for configs
lynxpath=/usr/bin/lynx
[[ ! -x $lynxpath ]] && lynxpath=/usr/local/bin/lynx
useragent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.79 Safari/537.1 Lynx"
if [ -e "$HOME/.config/lynx/lynx.cfg" ];then
export LYNX_CFG="$HOME/.config/lynx/lynx.cfg"
fi
if [ -e "$HOME/.config/lynx/lynx.lss" ];then
export LYNX_LSS="$HOME/.config/lynx/lynx.lss"
fi
if [ ! -x "$lynxpath" ]; then
echo "Doesn't look like lynx is installed."
exit 1
fi
exec "$lynxpath" --useragent="$useragent" "$@"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,116 @@
# Setting the normal and default types lets us keep (almost) the same colors
# whether the terminal's default colors are white-on-black or black-on-white.
# It is not exact since the default "white" is not necessarily the same color
# as the ANSI lightgray, but is as close as we can get in a standard way.
#
# If you really want the terminal's default colors, and if lynx is built using
# ncurses' default-color support, remove these two lines:
#normal: normal: lightgray:black
#default: normal: white:black
# Normal type styles correspond to HTML tags.
#
# The next line (beginning with "em") means: use bold if mono, otherwise
# brightblue on <defaultbackground>
em: bold: brightblue
strong: bold: brightred
b: bold: red
i: bold: brightblue
a: bold: green
img: dim: brown
fig: normal: gray
caption: reverse: brown
hr: normal: yellow
blockquote: normal: brightblue
ul: normal: brown
address: normal: magenta
title: normal: magenta
tt: dim: brightmagenta: black
h1: bold: white: blue
label: normal: magenta
q: normal: yellow: magenta
small: dim: default
big: bold: yellow
sup: bold: yellow
sub: dim: gray
li: normal: magenta
code: normal: cyan
cite: normal: cyan
table: normal: brightcyan
tr: bold: brown
td: normal: default
br: normal: default
# Special styles - not corresponding directly to HTML tags
# alert - status bar, when message begins "Alert".
# alink - active link
# normal - default attributes
# status - status bar
# whereis - whereis search target
#
#normal:normal:default:blue
alink: reverse: yellow: black
status: reverse: cyan: default
alert: bold: yellow: red
#whereis: reverse+underline: magenta: cyan
whereis: bold+reverse: black: yellow
# currently not used
#value:normal:green
menu.bg: normal: black: lightgray
menu.frame: normal: black: lightgray
menu.entry: normal: lightgray: black
menu.n: normal: red: gray
menu.active: normal: yellow: black
menu.sb: normal: brightred: lightgray
forwbackw.arrow:reverse
hot.paste: normal: brightred: gray
# Styles with classes - <ul class=red> etc.
ul.red: underline: brightred
ul.blue: bold: brightblue
li.red: reverse: red: yellow
li.blue: bold: blue
strong.a: bold: black: red
em.a: reverse: black: blue
strong.b: bold: white: red
em.b: reverse: white: blue
strong.debug: reverse: green
font.letter: normal: white: blue
input.submit: normal: cyan
tr.baone: bold: yellow
tr.batwo: bold: green
tr.bathree: bold: red
#
# Special handling for link.
link: normal: white
link.green: bold: brightgreen
link.red: bold: black: red
link.blue: bold: white: blue
link.toc: bold: black: white
# Special cases for link - the rel or title is appended after the class.
# <link rel=next class=red href="1">
link.red.next: bold: red
link.red.prev: bold: yellow: red
link.blue.prev: bold: yellow: blue
link.blue.next: bold: blue
link.green.toc: bold: white: green
#
# Define styles that will be used when syntax highlighting is requested
# (commandline option -prettysrc).
span.htmlsrc_comment:normal: white
span.htmlsrc_tag:normal: white
#If you don't like that the tag name and attribute name are displayed
#in different colors, comment the following line.
span.htmlsrc_attrib:normal: cyan
span.htmlsrc_attrval:normal: magenta
span.htmlsrc_abracket:normal: white
span.htmlsrc_entity:normal: white
##span.htmlsrc_href:
##span.htmlsrc_entire:
span.htmlsrc_badseq:normal: red
span.htmlsrc_badtag:normal: red
span.htmlsrc_badattr:normal: red
span.htmlsrc_sgmlspecial:normal: yellow

@ -0,0 +1,5 @@
package main
func main() {
Cmd.Run()
}

@ -2302,7 +2302,6 @@ SCAN_FOR_BURIED_NEWS_REFS:FALSE
# If you use xli, you may want to add the -quiet flag.
#
#XLOADIMAGE_COMMAND:xli %s &
XLOADIMAGE_COMMAND:xdg-open %s &
.h2 VIEWER
# MIME types may be assigned to external viewers using
@ -2360,8 +2359,7 @@ XLOADIMAGE_COMMAND:xdg-open %s &
# The global and personal MAILCAP files allow you to specify external
# viewers to be spawned when Lynx encounters different MIME types, which
# will override any of the suffix maps in this (lynx.cfg) configuration
# file, or in src/HTInit.c. See
.url http://tools.ietf.org/html/rfc1524
# file, or in src/HTInit.c. See .url http://tools.ietf.org/html/rfc1524
# and the example mailcap file in the samples subdirectory.
#
# Unix:
@ -3122,7 +3120,7 @@ NESTED_TABLES: false
# enabled), see the KEYMAP section above.
#
#EXTERNAL:ftp:wget %s &:TRUE
EXTERNAL:http:open %s &:TRUE
EXTERNAL:http:google-chrome %s &:TRUE
.h2 EXTERNAL_MENU
# Like EXTERNAL, but allows customizing the menu name.
@ -3573,6 +3571,7 @@ TEXTFIELDS_NEED_ACTIVATION:TRUE
# this choice on a case-by-case basis.
#
#FORCE_SSL_PROMPT:PROMPT
FORCE_SSL_PROMPT:yes
.h2 FORCE_COOKIE_PROMPT
# If FORCE_COOKIE_PROMPT is set to "yes", then questionable conditions, such as
@ -3581,6 +3580,7 @@ TEXTFIELDS_NEED_ACTIVATION:TRUE
# this choice on a case-by-case basis.
#
#FORCE_COOKIE_PROMPT:PROMPT
FORCE_COOKIE_PROMPT:yes
.h2 SSL_CERT_FILE
# Set SSL_CERT_FILE to the file that contains all valid CA certificates lynx

@ -0,0 +1,2 @@
#!/bin/bash
for i in {1..10}; do echo $i. thing; done

@ -0,0 +1,2 @@
#!/bin/sh
exec VBoxManage.exe startvm --type headless anton

@ -1,9 +1,10 @@
#!/usr/bin/env bash
what="$*"
if [[ -z "${what}" ]]; then
what="in a bit"
what="in a bit"
elif [[ $what =~ ^([0-9]+) ]]; then
what="at $(date -d "${BASH_REMATCH[1]} minutes" +%-I:%M)"
what="at $(date -d "${BASH_REMATCH[1]} minutes" +%H:%M)"
fi
echo "$what" > ~/.break
echo "$what" >~/.break
exec bannerfish "back $what"
#exec bannerlights "back $what"

@ -0,0 +1,8 @@
#!/usr/bin/env bash
what="$*"
if [ -z "${what}" ]; then
read -p "Text: " what
fi
cols=$(tput lines)
pomo stop
tmux split-window \; resize-pane -y $((cols-6)) \; send -t 1 "banner \"$what\"" Enter \; send -t 2 "pylights" Enter

@ -0,0 +1,8 @@
#!/usr/bin/env bash
what="$*"
if [ -z "${what}" ]; then
read -p "Text: " what
fi
cols=$(tput lines)
pomo stop
tmux split-window \; resize-pane -y $((cols-6)) \; send -t 1 "banner \"$what\"" Enter \; send -t 2 "neo" Enter

@ -0,0 +1,2 @@
#!/usr/bin/env bash
entr bash -c "clear; shellcheck $1" <<< "$1"

@ -1,14 +0,0 @@
#!/usr/bin/env bash
year="$1"
firstday=$(date "+%A, %B %e, %Y" -d "May 4 $year")
firstweekday=$(date "+%u" -d "May 4 $year")
daystilsat=$((6-firstweekday))
sat=$(date "+%A, %B %e, %Y" -d "May 4 $year + $daystilsat days")
echo "$firstday"
for i in {0..16}; do
echo "$sat"
sat="$(date "+%A, %B %e, %Y" -d "$sat + 7 days")"
done

@ -4,5 +4,5 @@ time="$*"
[[ -z "$time" ]] && echo "usage: $0 TIME (see date -d)" && exit 1
start=$(date "+%s" -d "$time")
now=$(date "+%s")
declare -i secs=$((start-now))
declare -i secs=$((now-start))
sec2dur "$secs"

@ -1,2 +0,0 @@
#!/bin/sh
t 'Coworking/Coffee/Ranting #pomo #k8s #devops #tmux #vim #go #python #perl #shell'

@ -0,0 +1,8 @@
#!/usr/bin/env bash
trap "setterm --cursor on; clear; exit; trap -- - SIGINT SIGTERM" SIGTERM SIGINT
clear
zet view disclaimer
now
setterm --cursor off
while true; do sleep 2; done

@ -0,0 +1,3 @@
#!/usr/bin/env bash
what="$*"
exec bannerneo "pause for dancing"

@ -1,2 +0,0 @@
#!/usr/bin/env bash
exec docker-compose "$@"

@ -14,8 +14,8 @@ $SIG{"INT"} = \&handle;
# Keep in mind that you probably have to install libcurses-perl
# and Term::Animation from CPAN for this to work:
#
# sudo apt install libcurses-perl
# sudo cpan -I Term::Animation
# sudo apt install libcurses-perl make
# sudo cpan -I Term::Animation
#
# Special thanks to @UndeadLeech for adding the transparency. This is
# the *only* fish/asciiquarium without the default black background.

@ -0,0 +1,430 @@
#!/usr/bin/env bash
# Originally written by https://github.com/deyloop/dot
# Formats Markdown tables so that they are readable in text form
# Parses the table in order to print the formatted form.
#
# Supposed to be used as an UNIX filter, where the unformatted table
# should be sent to `stdin` and the formatted output will be sent to
# `stdout`.
# If a parsing error occures, prints the unformatted table unchanged,
# and exits with code 42
#
# In order to debug, look at `__fail`
# Does all the parsing in pure bash, in a single process. Printing uses
# a few subshells as that was convenient.
# TODO: support escaping pipe characters
# TODO: skipping to just tables when whole markdown document is passed
# TODO: allow filename to be passed as argument
#-------------------------------------------------------------------------
# The Parsing Grammar used:
#
# table -> newline headingrow delimrow tablebody
#
# headingrow -> pipe? headings pipe? newline
# headings -> content pipe headingsB
# headingsB -> content / content pipe headingsB
# content -> [^pipe]*
#
# delimrow -> pipe? delims pipe? newline
# delims -> delim pipe delimsB
# delimsB -> delim / delim pipe delimsB
# delim -> noalign / leftalign / centeralign / rightalign
# noalign -> dash dash dashes
# leftalign -> colon dash dashes
# centeralign -> colon dashes colon
# rightalign -> dash dashes colon
#
# tablebody -> nothing / tablerow tablebody
# tablerow -> pipe? body pipe? newline
# body -> content pipe bodyB
# bodyB -> content / content pipe bodyB
#
# dashes -> dash / dash dashes
# pipe -> '|'
# dash -> '-'
# colon -> ':'
#-------------------------------------------------------------------------
fmttable() {
local in=/dev/stdin
local buf
buf="$(<"$in")"
buf+=$'\n'
local i=0
local c
local -a contents
local col=0
local row=0
local totalcols=0
local -a colwidths
local -a colaligns
# parsing
_parse_table
# print the headings
printf "|"
for (( x=0; x<totalcols; x++ )); do
local w="${colwidths[$x]}"
printf "%-${w}s|" "${contents[$x]}"
done
printf "\n"
# print the delims
printf "|"
for (( x=0; x<${totalcols}; x++ )); do
local con
case ${colaligns[$x]} in
left)
con=":$(for ((i=0; i<$((${colwidths[$x]}-1)); i++)); do
printf "-";
done)"
;;
right)
con="$(for ((i=0; i<$((${colwidths[$x]}-1)); i++)); do
printf "-";
done):"
;;
center)
con=":$(for ((i=0; i<$((${colwidths[$x]}-2)); i++)); do
printf "-";
done):"
;;
none)
con="$(for ((i=0; i<${colwidths[$x]}; i++)); do
printf "-";
done)"
;;
esac
local w="${colwidths[$x]}"
printf "%-${w}s|" "$con"
done
printf "\n"
# print the body
for (( y=2; y<row; y++ )); do
printf "|"
for (( x=0; x<totalcols; x++ )); do
local w="${colwidths[$x]}"
local a=""
[[ ${colaligns[$x]} != right ]] && a="-"
printf "%${a}${w}s|" "${contents[$y*$totalcols+$x]}"
done
printf "\n"
done
}
__fail(){
printf "%s" "$buf"
echo
echo "$row:$col - $1"
exit 42
}
_parse_table() {
_parse_headingrow
_parse_delimrow
_parse_tablebody
}
_parse_headingrow(){
_nextchar
[[ $c != '|' ]] && _putback
_parse_headings
_nextchar
[[ $c != '|' ]] && _putback
_parse_newline
totalcols=$col
row=$((row+1))
}
_advance_col() {
shopt -s extglob
local trimed="${contents[$row*$totalcols+$col]}"
trimed="${trimed##+([[:space:]])}"
trimed="${trimed%%+([[:space:]])}"
contents[$row*$totalcols+$col]="$trimed"
local colw="${#trimed}"
local w="${colwidths[$col]}"
if [[ $colw -gt $w ]]; then colwidths[$col]="$colw"; fi
col=$((col+1))
}
_parse_headings() {
_parse_content
_advance_col
_parse_pipe
_parse_headingsB
}
_parse_content() {
_nextchar
if [[ $c = '|' || $c = $'\n' ]]; then
_putback
else
contents[$row*$totalcols+$col]+="$c"
_parse_content
fi
}
_parse_pipe() {
_nextchar
[[ $c != '|' ]] && __fail "expected pipe, found '$c'"
}
_parse_headingsB() {
_parse_content
_advance_col
_nextchar
if [[ $c = '|' ]]; then
_nextchar
if [[ $c = $'\n' ]]; then
_putback
_putback
else
_putback
_putback
_parse_pipe
_parse_headingsB
fi
else
if [[ $c = $'\n' ]]; then
_putback
fi
fi
}
_parse_newline() {
_nextchar
[[ $c != $'\n' ]] && __fail "expected newline, found '$c'"
}
_parse_delimrow(){
col=0
_nextchar
[[ $c != '|' ]] && _putback
_parse_delims
_nextchar
[[ $c != '|' ]] && _putback
_parse_newline
row=$((row+1))
}
_parse_delims() {
_parse_delim
col=$((col+1))
_parse_pipe
_parse_delimsB
}
_parse_delimsB() {
_parse_delim
col=$((col+1))
_nextchar
if [[ $c = '|' ]]; then
_nextchar
if [[ $c = $'\n' ]]; then
_putback
_putback
else
_putback
_putback
_parse_pipe
_parse_delimsB
fi
else
if [[ $c = $'\n' ]]; then
_putback
fi
fi
}
_parse_delim() {
local remainingbuf=${buf:$i}
local lookahead=${remainingbuf%%\|*}
if [[ $lookahead =~ ^[[:space:]]*:-+:[[:space:]]*$ ]]; then
colaligns[$col]="center"
_parse_centeralign
return
fi
if [[ $lookahead =~ ^[[:space:]]*:--+[[:space:]]*$ ]]; then
colaligns[$col]="left"
_parse_leftalign
return
fi
if [[ $lookahead =~ ^[[:space:]]*---+[[:space:]]*$ ]]; then
colaligns[$col]="none"
_parse_noalign
return
fi
if [[ $lookahead =~ ^[[:space:]]*--+:[[:space:]]*$ ]]; then
colaligns[$col]="right"
_parse_rightalign
return
fi
}
_parse_skipspaces() {
_nextchar
if [[ $c = ' ' ]]; then
_parse_skipspaces
else
_putback
fi
}
_parse_noalign() {
_parse_skipspaces
_parse_dash
_parse_dash
_parse_dashes
_parse_skipspaces
}
_parse_leftalign() {
_parse_skipspaces
_parse_colon
_parse_dash
_parse_dashes
_parse_skipspaces
}
_parse_centeralign(){
_parse_skipspaces
_parse_colon
_parse_dashes
_parse_colon
_parse_skipspaces
}
_parse_rightalign() {
_parse_skipspaces
_parse_dash
_parse_dashes
_parse_colon
_parse_skipspaces
}
_parse_dash() {
_nextchar
[[ $c != '-' ]] && __fail "expected dash, found '$c'"
}
_parse_dashes() {
_parse_dash
_nextchar
if [[ $c = '-' ]]; then
_putback
_parse_dashes
else
_putback
fi
}
_parse_colon() {
_nextchar
[[ $c != ':' ]] && __fail "expected colon, fount '$c'"
}
_parse_tablebody(){
local bi=$((${#buf}-1))
if [[ $i -lt $bi ]]; then
_parse_tablerow
_parse_tablebody
else
return
fi
}
_parse_tablerow() {
col=0
_nextchar
[[ $c != '|' ]] && _putback
_parse_body
_nextchar
[[ $c != '|' ]] && _putback
row=$((row+1))
_parse_newline
}
_parse_body() {
_parse_content
_advance_col
_parse_pipe
_parse_bodyB
}
_parse_bodyB() {
_parse_content
_advance_col
_nextchar
if [[ $c = '|' ]]; then
_nextchar
if [[ $c = $'\n' ]]; then
_putback
_putback
else
_putback
_putback
_parse_pipe
_parse_bodyB
fi
else
if [[ $c = $'\n' ]]; then
_putback
fi
fi
}
_nextchar() {
if [[ $i -lt "${#buf}" ]]; then
c="${buf:$i:1}"
i=$((i+1))
else
__fail "Unexpectedly reached EOF"
fi
}
_putback() {
i=$((i-1))
}
fmttable

@ -0,0 +1,11 @@
#!/usr/bin/env bash
addcopyright() {
file=$(tempfile)
cat <(echo "// Copyright 2022 Robert S. Muhlestein
// SPDX-License-Identifier: Apache-2.0
") "$1" >> "$file"
mv "$file" "$1"
}
for f in "$@"; do addcopyright "$f"; done

@ -0,0 +1,2 @@
#!/usr/bin/env bash
entr bash -c "clear; go test $*" < <(find .)

@ -0,0 +1,21 @@
#!/usr/bin/env bash
_trim() {
local it="${1#"${1%%[![:space:]]*}"}"
it="${it%%//*}"
echo -e "${it%"${it##*[![:space:]]}"}"
}
interface="$1"
receiver="$2"
while IFS= read -r sig; do
sig=$(_trim "$sig")
name=${sig%%(*}
echo "//$name implements $interface interface."
# TODO get fancy with return type detection
echo "func (s $receiver) $sig {}"
done

@ -0,0 +1,9 @@
#!/usr/bin/env bash
echo '
// adjust log output for testing
log.SetOutput(os.Stdout)
log.SetFlags(0)
defer log.SetOutput(os.Stderr)
defer log.SetFlags(log.Flags())
'

@ -1,6 +1,6 @@
#!/bin/sh
url="https://google.com/search?q=$(urlencode "$*")"
chat "$url"
#chat "$url"
exec lynx "https://google.com/search?q=$url"
#useragent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.79 Safari/537.1"
#/usr/bin/lynx "--useragent=$useragent" "google.com/search?q=$*"

@ -0,0 +1,27 @@
#!/usr/bin/env bash
read -r name
echo "
// ---------------------------- PrintAsJSON ---------------------------
func (s *$name) MarshalJSON() ([]byte, error) {
buf := ""
// TODO
return []byte(buf),nil
}
// JSON implements PrintAsJSON multi-line, 2-space indent JSON output.
func (s *$name) JSON() string {b,_ :=s.MarshalJSON();return string(b)}
func (s *$name) JSON() string {b,_ :=json.Marshal(s);return string(b)}
// String implements PrintAsJSON and fmt.Stringer interface as JSON.
func (s $name) String() string {return s.JSON()}
// Print implements PrintAsJSON.
func (s *$name) Print() { fmt.Println(s.JSON()) }
// Log implements PrintAsJSON.
func (s $name) Log() { log.Print(s.JSON()) }
"

@ -0,0 +1,20 @@
#!/usr/bin/env bash
_have() { type "$1" &>/dev/null; }
declare OPENAI_API_KEY
OPENAI_API_KEY="$(head -1 "$HOME/.config/gpt/token")"
export OPENAI_API_KEY
! _have mods && echo "requires charmbracelet/mods" && exit 1
if test -t 0; then
if _have glow; then
mods --status-text "Ummm" -f "$*" | glow
else
mods --status-text "Ummm" "$*"
fi
else
mods --quiet "$*" | sed 's,[?25l [?25h[?1002l[?1003l,,g'
# |sed 's/\x1B\[[0-9;\?]*[a-zA-Z]//g'
fi

@ -1,2 +1,2 @@
#!/bin/sh
echo '## '$(now "$*")
#!/usr/bin/env bash
echo "***$(now)***"

@ -0,0 +1,3 @@
#!/bin/sh
#open "https://twitch.tv/$1"
chat /msg "$TWITCH_USER" /host "$1"

@ -0,0 +1,9 @@
#!/usr/bin/env bash
for (( i=1; i<=$1; i++ )) do
echo "## Task $i"
echo
echo "> "
echo
done

@ -2,6 +2,8 @@
# Produces a centered title in the middle of a horizontal rule of text.
pre='//'
_filter(){
[[ -n "$1" ]] && return 1
while IFS= read -ra args; do
@ -17,7 +19,7 @@ htitle() {
local -i left=$side
local -i right=$side
(( len % 2 == 1 )) && ((right -= 1))
echo "# $(echon "$char" "$left") "$str" $(echon "$char" "$right")"
echo "$pre $(echon "$char" "$left") "$str" $(echon "$char" "$right")"
}
htitle "$@"

@ -1,2 +0,0 @@
#!/bin/sh
exec date -u +%Y%m%d%H%M%S%N "$@"

@ -0,0 +1,2 @@
#!/usr/bin/env bash
exec curl -sSL "http://metaphorpsum.com/paragraphs/$1"

@ -1,11 +1,11 @@
#!/bin/sh
#!/usr/bin/env bash
# be sure to install the ca-certificates package
# see ../lynx/README.md for configs
lynxpath=/usr/bin/lynx
[[ -x $lynxpath ]] || lynxpath=/usr/local/bin/lynx
[[ ! -x $lynxpath ]] && lynxpath=/usr/local/bin/lynx
useragent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.79 Safari/537.1 Lynx"

@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
count=1
if test -n "$1"; then

@ -0,0 +1,2 @@
#!/bin/bash
less -R < <("$@")

@ -13,14 +13,14 @@ marquee() {
local -a timebar topicbar
#topic="$(topic)" topic="${topic#* }"
topic="$(head -1 ~/.currently)"
#pomo="$(pomo)" pomo=${pomo%%m*} pomo=${pomo%%s*}
pomo="$(pomo)"
#mode="$(iam mode emoji)"
zet="zet:$(zet current)"
time="$(date +"%A, %B %-e, %Y, %-H:%M %Z%0z")"
replay=$(printf "(%02d)" "$((20-$(date +"%S")%20))")
time="$(date +"%A, %B %-e, %Y, %-I:%M%p %Z%0z")"
isosec="$(isosec)"
tilboost="$(countdown 11:11:11 May 4)"
[[ -n "$pomo" ]] && timebar+=("$pomo")
[[ -n "$pomo" ]] && topicbar+=("$pomo")
#[[ -n "$pomo" ]] && timebar+=("$pomo")
#[[ -n "$pomo" ]] && topicbar+=("$pomo")
[[ -n "$time" ]] && timebar+=("$time")
[[ -n "$topic" ]] && topicbar+=("$topic")
timebarb="${timebar[*]}"
@ -28,12 +28,14 @@ marquee() {
topicremain=$(( $(tput cols) - ${#topicbarb} ))
timeremain=$(( $(tput cols) - ${#timebarb} ))
topicspace=$(( topicremain - ${#mode} - ${#zet}))
timespace=$(( timeremain - ${#mode} - ${#zet} - ${#tilboost} - 5))
timespace=$(( timeremain - ${#mode} - ${#zet} - ${#tilboost} - ${#isosec}))
#if (( $(date +%s)%20 < 10 ));then
#echo "$topicbarb $(repeat $' ' "$topicspace") rwxrob.tv"
#else
#echo "$mode $timebarb $(repeat $' ' "$timespace") rwxrob.tv $zet"
echo "$timebarb $replay [boost in $tilboost] $(repeat $' ' "$timespace") rwxrob.tv"
#echo "$timebarb $replay [boost in $tilboost] $(repeat $' ' "$timespace") rwxrob.tv"
#echo "$timebarb ($isosec) [boost: $tilboost]"
echo "$timebarb ($isosec)"
#fi
}

@ -1,47 +1,4 @@
#!/usr/bin/env bash
## See, now *this* is why using only hashtag headers in Markdown are so
## essential. Imagine doing this if level one and two headers could
## also be the stupid underline style.
toc () {
declare file=$(mktemp)
#TODO make it smarter, just need something quick for now
echo cat $file
while IFS= read -r line;do
if [[ $line =~ ^#+\ ]]; then
echo $line >> $file
fi
echo "$line"
done
}
imagelinks () {
declare dir="${1-.}"
find "$dir" -regextype posix-extended -regex '.+(png|jpg|gif)$' -printf "![](%p)\n"
}
########################## Command Delegation ##########################
declare subcommand="$1"; shift
declare -a commands=( toc imagelinks)
######################### Tab Completion Context ########################
if [ -n "$COMP_LINE" ]; then
pre=${COMP_LINE#* }
for cmd in ${commands[@]}; do
[[ $cmd =~ ^$pre ]] && echo $cmd
done
exit 0
fi
###################### Regular Context Delegation ######################
for i in ${commands[@]}; do
if [[ $i == "$subcommand" ]]; then
"$subcommand" $*
exit 0
fi
done
#!/bin/sh
test -z "$@" && test -f ./README.md && exec glow -p ./README.md
exec glow -p "$@"

@ -0,0 +1,47 @@
#!/usr/bin/env bash
## See, now *this* is why using only hashtag headers in Markdown are so
## essential. Imagine doing this if level one and two headers could
## also be the stupid underline style.
toc () {
declare file=$(mktemp)
#TODO make it smarter, just need something quick for now
echo cat $file
while IFS= read -r line;do
if [[ $line =~ ^#+\ ]]; then
echo $line >> $file
fi
echo "$line"
done
}
imagelinks () {
declare dir="${1-.}"
find "$dir" -regextype posix-extended -regex '.+(png|jpg|gif)$' -printf "![](%p)\n"
}
########################## Command Delegation ##########################
declare subcommand="$1"; shift
declare -a commands=( toc imagelinks)
######################### Tab Completion Context ########################
if [ -n "$COMP_LINE" ]; then
pre=${COMP_LINE#* }
for cmd in ${commands[@]}; do
[[ $cmd =~ ^$pre ]] && echo $cmd
done
exit 0
fi
###################### Regular Context Delegation ######################
for i in ${commands[@]}; do
if [[ $i == "$subcommand" ]]; then
"$subcommand" $*
exit 0
fi
done

@ -1,2 +0,0 @@
#!/bin/sh
exec less -R "$@"

@ -5,7 +5,7 @@ test ! -n "${1}" && echo "usage: newscript <name>" && exit 1;
path="${SCRIPTS}/${1}"
if [ -e "${path}" ]; then
if test -e "${path}"; then
read -p "${1} already exists. Edit? " yes
case "${yes}" in
y|yes|yep|yeppers|yeah|ok|okay) exec vim "${path}"

@ -1,26 +1,57 @@
#!/usr/bin/perl
#!/usr/bin/env perl
# Opens what you would expect. If there is no argument passed to it
# checks if this is a GitHub repo and if so opens it with the gh tool in
# your browser. Otherwise, it checks if the argument is a file in the
# current directory and opens it with the default application (xdg-open).
# Finally, it assumes it is a URL, ensures begins with https:// and
# opens it in a new window with Firefox.
# current directory and opens it with the default application
# (xdg-open). Finally, it assumes it is a URL, ensures begins with
# https:// and opens it in local web browser.
#
use v5.14;
$_ = shift;
if (not $_) {
my $gh = (grep {/github/ && s,git@,, && s,:,/, && s/\.git$//}
qx{git remote get-url --all origin})[0];
# $gh and exec 'firefox', '-new-window', "https://$gh";
$gh and exec 'google-chrome', "https://$gh";
}
$| = 1;
# markdown file
if (/\.md$/) {
`pandoc -s -o /tmp/index.html $_ 2>/dev/null`;
exec 'lynx', '/tmp/index.html';
say "markdown file detected";
if (not `which pandoc`) {
say "pandoc not found";
exit 1;
}
if (not `which lynx`) {
say "lynx not found";
exit 1;
}
`pandoc -s -o /tmp/index.html $_ 2>/dev/null`;
system 'lynx', '/tmp/index.html';
exit
}
# file
if (-r $_) {
`which xdg-open` && exec 'xdg-open', $_;
`which /usr/bin/open` && exec '/usr/bin/open', $_;
`which explorer.exe` && exec 'explorer.exe', $_;
say "unable to open file: $_";
exit 1;
}
# git repo
if ($_) {
my $gh = (grep {/github/ && s,git@,, && s,:,/, && s/\.git$//} qx{git remote get-url --all origin})[0];
if ($gh) {
system 'gh', 'repo', 'view','--web';
exit;
}
}
-r $_ && exec 'xdg-open', $_;
# bare url
m,^http, or s,^,https://,;
-x '/mnt/c/Windows/explorer.exe' and exec 'explorer.exe', $_;
exec 'google-chrome', $_;
`which lynx` && exec 'lynx', $_;
`which /usr/bin/open` && exec '/usr/bin/open', $_;
`which explorer.exe` && exec 'explorer.exe', $_;
`which google-chrome` && exec 'google-chrome', $_;
my $chrome = '/System/Applications/Google\ Chrome.app';
`which $chrome` && exec "$chrome", "$_";
say "unable to determine how to open $_";

@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
shopt -s extglob
chat "${1//+($'\n')/ }"
twitter update "$@"

@ -0,0 +1,56 @@
#!/bin/sh
# maintained in https://github.com/rwxrob/skilstak/ in
# projects/shell/powersource
if [ -t 1 ]; then
w="\e[38;5;237m"
b="\e[38;5;39m"
g="\e[38;5;46m"
s="\e[38;5;112m"
y="\e[38;5;190m"
o="\e[38;5;208m"
r="\e[38;5;160m"
v="\e[38;5;93m"
fi
f=0
if [ -n "$1" ]; then
f="$1"
elif [ -n "$FTP" ]; then
f="$FTP"
else
read -r f
fi
k=0
if [ -n "$2" ]; then
k="$2"
elif [ -n "$WEIGHT" ]; then
k="$WEIGHT"
else
read -r k
fi
h=0
if [ -n "$3" ]; then
h="$3"
elif [ -n "$HEIGHT" ]; then
h="$HEIGHT"
else
read -r h
fi
echo " HEIGHT : $h"
echo " WEIGHT : $k"
echo " FTP : $f ($(echo "scale=2;$f/$k"|bc))"
echo
printf "${w}Recovery (1): 😴 - %.0f\n" "$(echo "$f*.56"|bc)"
printf "${b}Endurance (2): %.0f - %.0f\n" "$(echo "$f*.56"|bc)" "$(echo "$f*.75"|bc)"
printf "${g}Tempo (3): %.0f - %.0f\n" "$(echo "$f*.76"|bc)" "$(echo "$f*.90"|bc)"
printf "${s}SweetSpot (3.5): %.0f - %.0f\n" "$(echo "$f*.84"|bc)" "$(echo "$f*.97"|bc)"
printf "${y}Threshold (4): %.0f - %.0f\n" "$(echo "$f*.91"|bc)" "$(echo "$f*1.05"|bc)"
printf "${o}VO2 Max (5): %.0f - %.0f\n" "$(echo "$f*1.06"|bc)" "$(echo "$f*1.2"|bc)"
printf "${r}Anaerobic (6): %.0f - %.0f\n" "$(echo "$f*1.21"|bc)" "$(echo "$f*1.5"|bc)"
printf "${v}Neuromuscular (7): %.0f - 🤮\n" "$(echo "$f*1.5"|bc)"

@ -0,0 +1,5 @@
#!/usr/bin/env bash
hidecursor
trap "setterm --cursor on; echo ${clear}; exit; trap -- - SIGINT SIGTERM" SIGTERM SIGINT
python /home/rwxrob/Repos/github.com/skilstak/pyfun/lib/pylights.py

@ -0,0 +1,3 @@
#!/bin/sh
#open "https://twitch.tv/$1"
chat /msg "$TWITCH_USER" /raid "$1"

@ -0,0 +1,3 @@
#!/usr/bin/env bash
echo "$(( RANDOM%20 + 1 ))"

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# This script will monitor the passed script (by path, default is
# 'build') for changes using entr and run shellcheck when changes are
# detected.
declare script=build
if [[ -n "$1" ]]; then
script=$1
fi
entr bash -c 'clear; shellcheck '"$script" <<< "$script"

@ -1 +0,0 @@
/Users/rmuhlest/repos/github.com/rwxrob/dot/scripts

@ -1,15 +1,12 @@
#!/usr/bin/env bash
seconds="$1"
[[ -z "$seconds" ]] && echo "usage: $0 SECONDS" && exit 1
minus=${seconds:0:1}
seconds=${seconds#-}
days=$((seconds/86400))
out=""
(( days > 0 )) && out="${days}."
(( seconds -= (days*86400) ))
hours=$((seconds/3600))
(( hours > 0 )) && out+="${hours}."
(( seconds -= (hours*3600) ))
minutes=$((seconds/60))
(( minutes > 0 )) && out+="${minutes}."
(( seconds -= (minutes*60) ))
out+="$seconds"
echo "$out"
printf "%s%i.%02i.%02i.%02i" "$minus" "$days" "$hours" "$minutes" "$seconds"

@ -0,0 +1,35 @@
#!/usr/bin/env bash
# This script replaces a section of text in a file marked by the bash
# regular expression passed as the first argument and ending with the
# second argument with the text in the the third argument The beginning
# and ending lines themselves are discarded when replaced.
ssection () {
local beg="$1" end="$2" buf="$3"
[[ -z "$beg" || -z "$end" ]] && echo "usage: ${0##*/} BEGX ENDX [STRING]" && return 1
local in=no
while IFS= read -r line; do
if [[ "$line" =~ $beg ]]; then
in=yes
continue
fi
if [[ "$line" =~ $end ]]; then
in=no
printf "$buf\n\n"
continue
fi
[[ "$in" == no ]] && echo "$line"
done
}
ssection "$@"

@ -0,0 +1,4 @@
#!/usr/bin/env bash
VBoxHeadless --startvm control &
VBoxHeadless --startvm node1 &
VBoxHeadless --startvm node2 &

@ -16,6 +16,8 @@ emoji[tv]=📺
emoji[update]=📰
emoji[tux]=🐧
emoji[tux]=🐧
emoji[poop]=💩
emoji[yoga]=🧘
emoji[facepalm]=🤦
toemoji() {

@ -0,0 +1,2 @@
#!/usr/bin/env bash
echo '🚧 *under construction* 🚧'

@ -0,0 +1,4 @@
#!/usr/bin/env bash
while IFS= read line; do
echo ${line^^}
done

@ -1,2 +1,2 @@
#!/bin/sh
exec curl -L wttr.in
exec curl -L wttr.in?0

@ -1,5 +1,4 @@
#!/usr/bin/env perl
# ^^^ only because this is a rapid prototype
# This is an unoptimized prototype with lots of subshells in preparation
# for port to Go eventually. In other words, this just works for now.

@ -0,0 +1,3 @@
#!/bin/sh
export KEG_CURRENT="$HOME/Repos/github.com/rwxrob/zet/docs"
exec keg "$@"

@ -0,0 +1,3 @@
user=""
repo=""
latest=$(curl -sSL "https://api.github.com/repos/$user/$repo/releases/latest" | jq -r .name)

@ -12,8 +12,9 @@ set -g status-interval 1
set -g status-bg default
set -g status-justify centre
set -g status-right ""
set -g status-right-style "fg=#928374,bold"
set -g status-right "#(pomo) "
#set -g status-right-style "fg=#928374,bold"
set -g status-right-style "fg=#665c54,bold"
set -g status-left-length 100
set -g status-left "#(marquee)"
set -g status-left-style "fg=#665c54"
@ -23,8 +24,8 @@ set -g window-status-current-format ""
# pane colors and display
#set -g default-terminal "xterm-256color" # very wrong indeed
#set -ga terminal-overrides ",xterm-256color*:Tc" # very wrong indeed
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color*:Tc" # very wrong indeed
#set -g default-terminal "screen-256color"
# create more intuitive split key combos (same as modern screen)
unbind |
@ -43,7 +44,7 @@ setw -g mode-keys vi
set -g status-keys vi
# vi keys to resize
bind -r C-k resize-pane -U 1
bind -r C-k resize-pane -U 2
bind -r C-j resize-pane -D 1
bind -r C-h resize-pane -L 1
bind -r C-l resize-pane -R 1

@ -1,25 +1,20 @@
# Configured by Rob Muhlestein (rwxrob.live)
# Configured by Rob Muhlestein (rwxrob.tv)
# This file is copyright free (public domain).
# fix accidently typing accent characters, etc.
# by forcing the terminal to not wait around
# (every single tmux file should have this)
set -sg escape-time 0
# change default meta key to same as screen
unbind C-b
unbind C-a
set -g prefix C-a
# form vim/tmux d/y buffer sync
set -g focus-events
# use a different prefix for nested
bind-key -n C-y send-prefix
# reload configuration
bind -r r source-file ~/.tmux.conf
# add double-tap meta key to toggle last window
bind-key C-a last-window
# use a different prefix for nested
bind-key -n C-y send-prefix
# pane colors and display
# create more intuitive split key combos (same as modern screen)
@ -53,9 +48,9 @@ bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R
# customize new window for streaming
unbind c
bind c new-window \; split-window -h \; select-pane -t 2 \; resize-pane -x 23 \; send "blankpane" Enter \; select-pane -t 1
# customize create new window for streaming
unbind C-c
bind C-c new-window \; split-window -h \; select-pane -t 2 \; resize-pane -x 19 \; send "blankpane" Enter \; select-pane -t 1
# avoid cursor movement messing with resize
set -g repeat-time 200
@ -64,7 +59,7 @@ set -g repeat-time 200
#set -g default-terminal "xterm-256color" # works, but oh so wrong
#set -ga terminal-overrides ",xterm-256color*:Tc"
set -g default-terminal "screen-256color"
#set -g clock-mode-style 12
set -g clock-mode-style 12
setw -g clock-mode-colour cyan
set -g base-index 1
setw -g pane-base-index 1
@ -82,24 +77,22 @@ set -g mode-style "bg=black"
# very unique Mac bug
if-shell "type 'reattach-to-user-namespace' >/dev/null" "set -g default-command 'reattach-to-user-namespace -l $SHELL'"
# reload configuration
bind -r r source-file ~/.tmux.conf
set -g status-style "fg=#665c54"
set -g status-bg default
set -g status-position top
set -g status-interval 1
set -g status-left ""
set -g status-right ""
#set -g status-left-length 78
#set -g status-left-style "fg=#928374,bold,reverse"
#set -g status-left-style "fg=#928374"
#set -g status-left-style "fg=brightwhite"
#set -g status-left "#(now) "
#set -g status-left "#(head -1 ~/.status) "
#set -g status-right-length 50
#set -g status-right "%a, %b %-e, %Y, %-l:%M:%S%p %Z%0z"
#set -g status-right-style "fg=#928374,bold"
set -g status-right-length 50
set -g status-right "#(pomo)"
#set -g window-status-format ""
#set -g window-status-current-format ""
@ -108,3 +101,11 @@ set -g message-style "fg=red"
# disable status
#set -g status off
set -g status on
# fix accidently typing accent characters, etc.
# by forcing the terminal to not wait around
#set -sg escape-time 0
# form vim/tmux d/y buffer sync
set -g focus-events

@ -9,13 +9,24 @@ set nocompatible
"####################### Vi Compatible (~/.exrc) #######################
" automatically indent new lines
set autoindent
set autoindent " (alpine)
set noflash " (alpine-ish only)
" replace tabs with spaces automatically
set expandtab " (alpine)
" number of spaces to replace a tab with when expandtab
set tabstop=2 " (alpine)
" use case when searching
set noignorecase
" automatically write files when changing when multiple files open
set autowrite
" activate line numbers
set number
" deactivate line numbers
set nonumber
" turn col and row position on in bottom right
set ruler " see ruf for formatting
@ -23,10 +34,13 @@ set ruler " see ruf for formatting
" show command and insert mode
set showmode
set tabstop=2
"#######################################################################
" disable visual bell (also disable in .inputrc)
set t_vb=
let mapleader=","
set softtabstop=2
" mostly used with >> and <<
@ -49,15 +63,11 @@ if v:version >= 800
endif
" mark trailing spaces as errors
if has("match")
match ErrorMsg '\s\+$'
endif
match IncSearch '\s\+$'
" enough for line numbers + gutter within 80 standard
set textwidth=72
" replace tabs with spaces automatically
set expandtab
"set colorcolumn=73
" disable relative line numbers, remove no to sample it
set norelativenumber
@ -68,6 +78,9 @@ set norelativenumber
" turn on default spell checking
"set spell
" disable spellcapcheck
set spc=
" more risky, but cleaner
set nobackup
set noswapfile
@ -97,9 +110,10 @@ set noshowmatch
" wrap around when searching
set wrapscan
set nowrap
" Just the defaults, these are changed per filetype by plugins.
" Most of the utility of all of this has been superceded by the use of
" Just the formatoptions defaults, these are changed per filetype by
" plugins. Most of the utility of all of this has been superceded by the use of
" modern simplified pandoc for capturing knowledge source instead of
" arbitrary raw text files.
@ -147,6 +161,9 @@ filetype plugin on
" high contrast for streaming, etc.
set background=dark
" make gutter less annoying
hi SignColumn ctermbg=NONE
" base default color changes (gruvbox dark friendly)
hi StatusLine ctermfg=black ctermbg=NONE
hi StatusLineNC ctermfg=black ctermbg=NONE
@ -179,6 +196,7 @@ au FileType * hi ModeMsg ctermfg=black cterm=NONE ctermbg=NONE
au FileType * hi MoreMsg ctermfg=black ctermbg=NONE
au FileType * hi NonText ctermfg=black ctermbg=NONE
au FileType * hi vimGlobal ctermfg=black ctermbg=NONE
au FileType * hi goComment ctermfg=black ctermbg=NONE
au FileType * hi ErrorMsg ctermbg=234 ctermfg=darkred cterm=NONE
au FileType * hi Error ctermbg=234 ctermfg=darkred cterm=NONE
au FileType * hi SpellBad ctermbg=234 ctermfg=darkred cterm=NONE
@ -190,12 +208,17 @@ au FileType * hi IncSearch ctermbg=236 cterm=NONE ctermfg=darkred
au FileType * hi MatchParen ctermbg=236 ctermfg=darkred
au FileType markdown,pandoc hi Title ctermfg=yellow ctermbg=NONE
au FileType markdown,pandoc hi Operator ctermfg=yellow ctermbg=NONE
au FileType markdown,pandoc set tw=0
au FileType yaml hi yamlBlockMappingKey ctermfg=NONE
au FileType yaml set sw=2
au FileType bash set sw=2
au FileType c set sw=8
au FileType markdown,pandoc noremap j gj
au FileType markdown,pandoc noremap k gk
set cinoptions+=:0
" Edit/Reload vimr configuration file
" Edit/Reload vimrc configuration file
nnoremap confe :e $HOME/.vimrc<CR>
nnoremap confr :source $HOME/.vimrc<CR>
@ -207,17 +230,18 @@ if filereadable(expand("~/.vim/autoload/plug.vim"))
" github.com/junegunn/vim-plug
call plug#begin('~/.local/share/vim/plugins')
Plug 'sheerun/vim-polyglot'
Plug 'zah/nim.vim'
Plug 'conradirwin/vim-bracketed-paste'
Plug 'morhetz/gruvbox'
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
Plug 'vim-pandoc/vim-pandoc'
Plug 'rwxrob/vim-pandoc-syntax-simple'
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
Plug 'tpope/vim-fugitive'
Plug 'hashivim/vim-terraform'
Plug 'morhetz/gruvbox'
Plug 'dense-analysis/ale'
call plug#end()
" terraform
let g:terraform_fmt_on_save = 1
let g:ale_sign_error = '☠'
let g:ale_sign_warning = '🙄'
let g:ale_linters = {'go': ['gometalinter', 'gofmt','gobuild']}
" pandoc
let g:pandoc#formatting#mode = 'h' " A'
@ -241,21 +265,23 @@ if filereadable(expand("~/.vim/autoload/plug.vim"))
let g:go_highlight_diagnostic_warnings = 1
"let g:go_auto_type_info = 1 " forces 'Press ENTER' too much
let g:go_auto_sameids = 0
"let g:go_metalinter_command='golangci-lint'
"let g:go_metalinter_command='golint'
"let g:go_metalinter_autosave=1
" let g:go_metalinter_command='golangci-lint'
" let g:go_metalinter_command='golint'
" let g:go_metalinter_autosave=1
set updatetime=100
"let g:go_gopls_analyses = { 'composites' : v:false }
au FileType go nmap <leader>t :GoTest!<CR>
au FileType go nmap <leader>v :GoVet!<CR>
au FileType go nmap <leader>b :GoBuild!<CR>
au FileType go nmap <leader>c :GoCoverageToggle<CR>
au FileType go nmap <leader>i :GoInfo<CR>
au FileType go nmap <leader>l :GoMetaLinter!<CR>
au FileType go nmap <leader>m ilog.Print("made")<CR><ESC>
au FileType go nmap <leader>n iif err != nil {return err}<CR><ESC>
else
autocmd vimleavepre *.go !gofmt -w % " backup if fatih fails
endif
" force loclist to always close when buffer does (affects vim-go, etc.)
augroup CloseLoclistWindowGroup
autocmd!
autocmd QuitPre * if empty(&buftype) | lclose | endif
augroup END
" format perl on save
if has("eval") " vim-tiny detection
fun! s:Perltidy()
@ -266,6 +292,18 @@ endfun
"autocmd FileType perl autocmd BufWritePre <buffer> call s:Perltidy()
endif
" format shell on save
if has("eval") " vim-tiny detection
" TODO check for shfmt and shellcheck before defining
" FIXME stop from blowing away file when there is shell error
fun! s:FormatShell()
let l:pos = getcurpos()
"silent execute '%!shfmt' " FIXME: bug report to shfmt
call setpos('.', l:pos)
endfun
autocmd FileType sh autocmd BufWritePre <buffer> call s:FormatShell()
endif
"autocmd vimleavepre *.md !perl -p -i -e 's,(?<!\[)my `(\w+)` (package|module|repo|command|utility),[my `\1` \2](https://gitlab.com/rwxrob/\1),g' %
" fill in empty markdown links with duck.com search
@ -277,9 +315,9 @@ autocmd BufWritePost *.md silent !toemoji %
autocmd BufWritePost *.md silent !toduck %
" fill in anything beginning with @ with a link to twitch to it
" autocmd vimleavepre *.md !perl -p -i -e 's, @(\w+), [\\@\1](https://twitch.tv/\1),g' %
"autocmd vimleavepre *.md !perl -p -i -e 's, @(\w+), [\\@\1](https://twitch.tv/\1),g' %
" make Y consitent with D and C (yank til end)
" make Y consistent with D and C (yank til end)
map Y y$
" better command-line completion
@ -304,15 +342,19 @@ au bufnewfile,bufRead $SNIPPETS/python/* set ft=python
au bufnewfile,bufRead $SNIPPETS/perl/* set ft=perl
au bufnewfile,bufRead user-data set ft=yaml
au bufnewfile,bufRead meta-data set ft=yaml
au bufnewfile,bufRead keg set ft=yaml
au bufnewfile,bufRead *.bash* set ft=bash
au bufnewfile,bufRead *.{peg,pegn} set ft=config
au bufnewfile,bufRead *.gotmpl set ft=go
au bufnewfile,bufRead *.profile set filetype=sh
au bufnewfile,bufRead *.crontab set filetype=crontab
au bufnewfile,bufRead *ssh/config set filetype=sshconfig
au bufnewfile,bufRead .dockerignore set filetype=gitignore
au bufnewfile,bufRead *gitconfig set filetype=gitconfig
au bufnewfile,bufRead /tmp/psql.edit.* set syntax=sql
au bufnewfile,bufRead *.go set spell
au bufnewfile,bufRead *.go set spell spellcapcheck=0
au bufnewfile,bufRead commands.yaml set spell
au bufnewfile,bufRead *.txt set spell
"fix bork bash detection
if has("eval") " vim-tiny detection
@ -336,6 +378,7 @@ function! <SID>SynStack()
endfunc
endif
" start at last place you were editing
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"au BufWritePost ~/.vimrc so ~/.vimrc
@ -352,18 +395,18 @@ map <F12> :set fdm=indent<CR>
nmap <leader>2 :set paste<CR>i
" disable arrow keys (vi muscle memory)
"noremap <up> :echoerr "Umm, use k instead"<CR>
"noremap <down> :echoerr "Umm, use j instead"<CR>
"noremap <left> :echoerr "Umm, use h instead"<CR>
" noremap <up> :echoerr "Umm, use k instead"<CR>
" noremap <down> :echoerr "Umm, use j instead"<CR>
" noremap <left> :echoerr "Umm, use h instead"<CR>
" noremap <right> :echoerr "Umm, use l instead"<CR>
" inoremap <up> <NOP>
" inoremap <down> <NOP>
" inoremap <left> <NOP>
" inoremap <right> <NOP>
"
" better use of arrow keys, number increment/decrement
nnoremap <up> <C-a>
nnoremap <down> <C-x>
" nnoremap <up> <C-a>
" nnoremap <down> <C-x>
" Better page down and page up
noremap <C-n> <C-d>
@ -376,3 +419,4 @@ noremap <C-p> <C-b>
set rtp^=~/.vimpersonal
set rtp^=~/.vimprivate
set rtp^=~/.vimwork

Loading…
Cancel
Save