From 109a39f7a9ada978067c8bd5e72ba7a5dfe2031d Mon Sep 17 00:00:00 2001 From: rwxrob Date: Thu, 10 Feb 2022 22:28:18 -0500 Subject: [PATCH 01/64] Fix lynx bug --- scripts/lynx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lynx b/scripts/lynx index 37b101d..c68a23a 100755 --- a/scripts/lynx +++ b/scripts/lynx @@ -5,7 +5,7 @@ # 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" From ae8a71ebd2ef137fca4f3001f884280528edef86 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Thu, 10 Feb 2022 22:43:17 -0500 Subject: [PATCH 02/64] Fix lynx --- scripts/lynx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lynx b/scripts/lynx index c68a23a..f90b3c5 100755 --- a/scripts/lynx +++ b/scripts/lynx @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # be sure to install the ca-certificates package From c5978faca750b520c3ea8da70d8fad1b63a8be5f Mon Sep 17 00:00:00 2001 From: Rob Muhlestein Date: Fri, 11 Feb 2022 10:43:43 -0500 Subject: [PATCH 03/64] Fix perl shebang --- scripts/open | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/open b/scripts/open index 9724275..d9430b3 100755 --- a/scripts/open +++ b/scripts/open @@ -1,4 +1,4 @@ -#!/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 From 94b8e9b737e8ae1c4fcebcdf1f2464afb3c281c9 Mon Sep 17 00:00:00 2001 From: Rob Muhlestein Date: Fri, 11 Feb 2022 11:23:18 -0500 Subject: [PATCH 04/64] Add Mac and Windows support to open --- scripts/open | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/scripts/open b/scripts/open index d9430b3..36502c3 100755 --- a/scripts/open +++ b/scripts/open @@ -9,18 +9,37 @@ use v5.14; $_ = shift; + +# git repo 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"; } -if (/\.md$/) { + +# markdown file +if (/\.md$/ && `which pandoc` && `which lynx`) { `pandoc -s -o /tmp/index.html $_ 2>/dev/null`; exec 'lynx', '/tmp/index.html'; } --r $_ && exec 'xdg-open', $_; + +# file +if (-r $_) { + `which xdg-open` && exec 'xdg-open', $_; + `which /usr/bin/open` && exec '/usr/bin/open', $_; + `which explorer.exe` && exec 'explorer.exe', $_; + print "Unable to open file: $_"; + exit 1; +} + +# 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", "$_"; +print "Unable to determine how to open $_\n"; From aeca3f66549a0888942763c811a866298da2258a Mon Sep 17 00:00:00 2001 From: Rob Muhlestein Date: Fri, 11 Feb 2022 12:05:13 -0500 Subject: [PATCH 05/64] Fix quirks on mac --- .DS_Store | Bin 0 -> 6148 bytes .bashrc | 5 ++--- gh/config.yml | 10 +++++----- install/mac/install-twurl | 2 ++ lynx/lynx.cfg | 4 +++- scripts/lynxa | 2 +- scripts/open | 3 +++ scripts/post | 2 +- scripts/startvms | 4 ++++ 9 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 .DS_Store create mode 100755 install/mac/install-twurl create mode 100755 scripts/startvms diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b2a6b3e6c870dde3f033c72e8cfe8a9aab8f5326 GIT binary patch literal 6148 zcmeHKOG-mQ5UkdK0XJD@IalxoLx?BH1p*O5K%yk-`mJ&$ zdAwS@eht7D?@tfF48WA`h?9r0`MLYZZYpC$I`4SJ8;&2V!~XeYRDC(&+&dhx!2!FU z{QWj>y-ZV93P=GdAO)m=6!@hA-g{}&`$R=4AO)nrw*vlsXmrP3I3&iWgCRx$;)Lli zu49%UHct?H;gHA-&5}w?s?~^LNoT%QT`wFGlMbul!|KUa6N<&td4G#?SWi@x0#e{y zf!o~9y#GJaugw4FB<-Yt6!=#P*krj{F8E5-TSqVFy|&TUbg%iOyKx;9hG@scXvf@m fJDx{T)-_-AycZ6ML1#YbMEwl7E;1?b*9v?AELauN literal 0 HcmV?d00001 diff --git a/.bashrc b/.bashrc index 93d7a81..0f67cba 100644 --- a/.bashrc +++ b/.bashrc @@ -117,7 +117,6 @@ pathprepend() { # remember last arg will be first in path pathprepend \ /usr/local/bin \ - /usr/local/*/bin \ "$HOME/.local/bin" \ "$GHREPOS/cmd-"* \ "$SCRIPTS" @@ -140,7 +139,7 @@ pathappend \ # ------------------------------ cdpath ------------------------------ -export CDPATH=".:$GHREPOS:$DOT:$REPOS:/media/$USER:$HOME" +export CDPATH=".:$GHREPOS:$DOTFILES:$REPOS:/media/$USER:$HOME" # ------------------------ bash shell options ------------------------ @@ -226,7 +225,7 @@ 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 coin="clip '(yes|no)'" -alias grep="grep -P" +alias grep="pcregrep" alias minidockenv=". <(minikube docker-env)" alias top=bashtop alias iam=live diff --git a/gh/config.yml b/gh/config.yml index a0114ba..338f571 100644 --- a/gh/config.yml +++ b/gh/config.yml @@ -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 diff --git a/install/mac/install-twurl b/install/mac/install-twurl new file mode 100755 index 0000000..f2e6167 --- /dev/null +++ b/install/mac/install-twurl @@ -0,0 +1,2 @@ +#!/bin/bash +sudo gem install twurl diff --git a/lynx/lynx.cfg b/lynx/lynx.cfg index 5c89be1..22beb82 100644 --- a/lynx/lynx.cfg +++ b/lynx/lynx.cfg @@ -2302,7 +2302,9 @@ 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 & + +# https://github.com/rwxrob/dot/blob/main/scripts/open +XLOADIMAGE_COMMAND:open %s & .h2 VIEWER # MIME types may be assigned to external viewers using diff --git a/scripts/lynxa b/scripts/lynxa index b3ea042..f523dd0 100755 --- a/scripts/lynxa +++ b/scripts/lynxa @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash count=1 if test -n "$1"; then diff --git a/scripts/open b/scripts/open index 36502c3..43ab852 100755 --- a/scripts/open +++ b/scripts/open @@ -7,9 +7,12 @@ # Finally, it assumes it is a URL, ensures begins with https:// and # opens it in a new window with Firefox. + use v5.14; $_ = shift; +`env > /tmp/env` + # git repo if (not $_) { my $gh = (grep {/github/ && s,git@,, && s,:,/, && s/\.git$//} diff --git a/scripts/post b/scripts/post index fb70634..e79985a 100755 --- a/scripts/post +++ b/scripts/post @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash shopt -s extglob chat "${1//+($'\n')/ }" twitter update "$@" diff --git a/scripts/startvms b/scripts/startvms new file mode 100755 index 0000000..322c4b0 --- /dev/null +++ b/scripts/startvms @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +VBoxHeadless --startvm control & +VBoxHeadless --startvm node1 & +VBoxHeadless --startvm node2 & From 4a12ddfd5c590fbad95480361303467d8e8f52e9 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Mon, 14 Feb 2022 23:36:21 -0500 Subject: [PATCH 06/64] Add script updates --- .bashrc | 9 ++++++--- scripts/back | 2 +- scripts/go | 3 +++ scripts/marquee | 12 ++++++------ scripts/open | 5 +++-- scripts/sec2dur | 7 +------ scripts/ws | 1 - tmux/.tmux-live.conf | 5 +++-- 8 files changed, 23 insertions(+), 21 deletions(-) create mode 100755 scripts/go diff --git a/.bashrc b/.bashrc index 0f67cba..e941191 100644 --- a/.bashrc +++ b/.bashrc @@ -152,6 +152,10 @@ 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 + # ------------------------------ history ----------------------------- export HISTCONTROL=ignoreboth @@ -186,7 +190,7 @@ __ps1() { [[ -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 " + 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 @@ -222,11 +226,10 @@ alias chmox='chmod +x' 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="pcregrep" -alias minidockenv=". <(minikube docker-env)" alias top=bashtop alias iam=live diff --git a/scripts/back b/scripts/back index cbe67d5..ea9b245 100755 --- a/scripts/back +++ b/scripts/back @@ -3,7 +3,7 @@ what="$*" if [[ -z "${what}" ]]; then 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 exec bannerfish "back $what" diff --git a/scripts/go b/scripts/go new file mode 100755 index 0000000..61c01b2 --- /dev/null +++ b/scripts/go @@ -0,0 +1,3 @@ +#!/bin/sh +exec go1.18beta2 "$@" + diff --git a/scripts/marquee b/scripts/marquee index 19e9704..0b72d74 100755 --- a/scripts/marquee +++ b/scripts/marquee @@ -13,14 +13,13 @@ 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))") 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 +27,13 @@ marquee() { topicremain=$(( $(tput cols) - ${#topicbarb} )) timeremain=$(( $(tput cols) - ${#timebarb} )) topicspace=$(( topicremain - ${#mode} - ${#zet})) - timespace=$(( timeremain - ${#mode} - ${#zet} - ${#tilboost} - 5)) + timespace=$(( timeremain - ${#mode} - ${#zet} - ${#tilboost})) #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 [boost: $tilboost]" #fi } diff --git a/scripts/open b/scripts/open index 43ab852..ad5540f 100755 --- a/scripts/open +++ b/scripts/open @@ -17,8 +17,9 @@ $_ = 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"; + if ($gh) { + exec 'gh', 'repo', 'view','--web' + } } # markdown file diff --git a/scripts/sec2dur b/scripts/sec2dur index f1bb6de..df19f99 100755 --- a/scripts/sec2dur +++ b/scripts/sec2dur @@ -2,14 +2,9 @@ seconds="$1" [[ -z "$seconds" ]] && echo "usage: $0 SECONDS" && exit 1 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 "%i.%02i.%02i.%02i" "$days" "$hours" "$minutes" "$seconds" diff --git a/scripts/ws b/scripts/ws index 2882298..3016d87 100755 --- a/scripts/ws +++ b/scripts/ws @@ -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. diff --git a/tmux/.tmux-live.conf b/tmux/.tmux-live.conf index 94cdb22..be4182d 100644 --- a/tmux/.tmux-live.conf +++ b/tmux/.tmux-live.conf @@ -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" From 766f99ac55be7f9d51f13cd2f53699293f71b72d Mon Sep 17 00:00:00 2001 From: rwxrob Date: Thu, 17 Feb 2022 13:42:03 -0500 Subject: [PATCH 07/64] Add darker comments for Go to vim --- vim/.vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/vim/.vimrc b/vim/.vimrc index 482a2b2..72e7bfe 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -179,6 +179,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 From f06b53e5c5044365d9a75ee0f51535a1f25fa6f5 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Thu, 17 Feb 2022 20:03:01 -0500 Subject: [PATCH 08/64] Add mapleader="," and macro for go --- vim/.vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vim/.vimrc b/vim/.vimrc index 72e7bfe..2909829 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -27,6 +27,8 @@ set tabstop=2 "####################################################################### +let mapleader="," + set softtabstop=2 " mostly used with >> and << @@ -253,6 +255,7 @@ if filereadable(expand("~/.vim/autoload/plug.vim")) au FileType go nmap c :GoCoverageToggle au FileType go nmap i :GoInfo au FileType go nmap l :GoMetaLinter! + au FileType go nmap m ilog.Print("made") else autocmd vimleavepre *.go !gofmt -w % " backup if fatih fails endif From 0552b9b86ffa370a249081cd639587c605debbb6 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Fri, 18 Feb 2022 13:46:24 -0500 Subject: [PATCH 09/64] Fix open script --- scripts/open | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/scripts/open b/scripts/open index ad5540f..3ed1b89 100755 --- a/scripts/open +++ b/scripts/open @@ -3,29 +3,18 @@ # 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 a new window with Firefox. +# use v5.14; $_ = shift; -`env > /tmp/env` - -# git repo -if (not $_) { - my $gh = (grep {/github/ && s,git@,, && s,:,/, && s/\.git$//} - qx{git remote get-url --all origin})[0]; - if ($gh) { - exec 'gh', 'repo', 'view','--web' - } -} - # markdown file if (/\.md$/ && `which pandoc` && `which lynx`) { `pandoc -s -o /tmp/index.html $_ 2>/dev/null`; - exec 'lynx', '/tmp/index.html'; + system 'lynx', '/tmp/index.html'; + exit } # file @@ -37,6 +26,15 @@ if (-r $_) { 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; + } +} + # bare url m,^http, or s,^,https://,; `which lynx` && exec 'lynx', $_; From 3828b6855a6b251bb294835914c5ce09d6815a08 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Fri, 18 Feb 2022 13:47:34 -0500 Subject: [PATCH 10/64] Add anton script --- scripts/anton | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 scripts/anton diff --git a/scripts/anton b/scripts/anton new file mode 100755 index 0000000..32312bb --- /dev/null +++ b/scripts/anton @@ -0,0 +1,2 @@ +#!/bin/sh +exec VBoxManage.exe startvm --type headless anton From 6e51c56f887d6299314eed6d139157b9b3268e95 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Fri, 18 Feb 2022 20:01:49 +0000 Subject: [PATCH 11/64] Update install-go for 1.18 --- install/ubuntu/install-go | 41 +++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/install/ubuntu/install-go b/install/ubuntu/install-go index 449b128..79ec981 100755 --- a/install/ubuntu/install-go +++ b/install/ubuntu/install-go @@ -1,22 +1,33 @@ -#!/bin/sh +#!/usr/bin/env bash set -e -cd "$(mktemp -d)" +install_17() { + cd "$(mktemp -d)" -# TODO eventually update this to detect -os=mac -arch=amd64 + os=linux + arch=amd64 -file=$(curl -sSL "https://golang.org/dl/?mode=json" \ - | jq -r '.[0].files[] - | select(.os == "'"$os"'") - | select(.arch == "'"$arch"'") - | .filename') + file=$(curl -sSL "https://golang.org/dl/?mode=json" \ + | jq -r '.[0].files[] + | select(.os == "'"$os"'") + | select(.arch == "'"$arch"'") + | .filename') -curl -sSLO \ - -H "Accept: application/vnd.github.v3+json" \ - "https://dl.google.com/go/$file" + curl -sSLO \ + -H "Accept: application/vnd.github.v3+json" \ + "https://dl.google.com/go/$file" -sudo tar xzf "$file" -C /usr/local/ + sudo tar xzf "$file" -C /usr/local/ + + echo "Make sure /usr/local/go/bin is in PATH" +} + +upgrade_18() { + /usr/local/go/bin/go install golang.org/dl/go1.18beta2@latest + "$GOBIN/go1.18beta2" download + go install golang.org/x/tools/gopls@latest +} + +#install_17 +upgrade_18 -echo "Make sure /usr/local/go/bin is in PATH" From 403d6f5e9a41d12edd852586520bcc777dbf141e Mon Sep 17 00:00:00 2001 From: rwxrob Date: Fri, 18 Feb 2022 20:03:08 +0000 Subject: [PATCH 12/64] Add jq, pcregrep to install --- install/ubuntu/install-most-stuff-with-apt | 2 +- install/ubuntu/install-rancher-desktop | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100755 install/ubuntu/install-rancher-desktop diff --git a/install/ubuntu/install-most-stuff-with-apt b/install/ubuntu/install-most-stuff-with-apt index 659ce11..e755107 100755 --- a/install/ubuntu/install-most-stuff-with-apt +++ b/install/ubuntu/install-most-stuff-with-apt @@ -1,3 +1,3 @@ #!/bin/sh -sudo apt install nmap +sudo apt install nmap jq pcregrep diff --git a/install/ubuntu/install-rancher-desktop b/install/ubuntu/install-rancher-desktop deleted file mode 100755 index ed27882..0000000 --- a/install/ubuntu/install-rancher-desktop +++ /dev/null @@ -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 From 28d1ab269214f6f5d4c367b137b50e9efdf95cad Mon Sep 17 00:00:00 2001 From: rwxrob Date: Fri, 18 Feb 2022 20:03:31 +0000 Subject: [PATCH 13/64] Add GOBIN to go script --- scripts/go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/go b/scripts/go index 61c01b2..e764e01 100755 --- a/scripts/go +++ b/scripts/go @@ -1,3 +1,3 @@ #!/bin/sh -exec go1.18beta2 "$@" +exec "$GOBIN/go1.18beta2" "$@" From 4c62ce6b3030ebe7c69cfbefcdfe7b28dd00a2f1 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Fri, 18 Feb 2022 20:24:45 +0000 Subject: [PATCH 14/64] Add docker install --- .bashrc | 1 + install/ubuntu/install-docker | 5 +++++ install/ubuntu/install-most-stuff-with-apt | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 install/ubuntu/install-docker diff --git a/.bashrc b/.bashrc index e941191..a40cb93 100644 --- a/.bashrc +++ b/.bashrc @@ -67,6 +67,7 @@ export LESS_TERMCAP_so="" # blue export LESS_TERMCAP_ue="" # "0m" export LESS_TERMCAP_us="" # underline export ANSIBLE_INVENTORY="$HOME/.config/ansible/ansible_hosts" +export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock [[ -d /.vim/spell ]] && export VIMSPELL=("$HOME/.vim/spell/*.add") diff --git a/install/ubuntu/install-docker b/install/ubuntu/install-docker new file mode 100755 index 0000000..fb80b34 --- /dev/null +++ b/install/ubuntu/install-docker @@ -0,0 +1,5 @@ +#!/bin/sh + +clone docker/docker-install +./install.sh +dockerd-rootless-setuptool.sh install diff --git a/install/ubuntu/install-most-stuff-with-apt b/install/ubuntu/install-most-stuff-with-apt index e755107..df497af 100755 --- a/install/ubuntu/install-most-stuff-with-apt +++ b/install/ubuntu/install-most-stuff-with-apt @@ -1,3 +1,3 @@ #!/bin/sh -sudo apt install nmap jq pcregrep +sudo apt install nmap jq pcregrep lynx make uidmap From 48248307c39c1a0bb297179d63d04ad994816e9c Mon Sep 17 00:00:00 2001 From: rwxrob Date: Sat, 19 Feb 2022 00:50:21 +0000 Subject: [PATCH 15/64] Add better dep checks to open script --- install/ubuntu/install-pandoc | 2 +- scripts/open | 28 +++++++++++++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/install/ubuntu/install-pandoc b/install/ubuntu/install-pandoc index 1fbfc4e..a886ef3 100755 --- a/install/ubuntu/install-pandoc +++ b/install/ubuntu/install-pandoc @@ -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" diff --git a/scripts/open b/scripts/open index 3ed1b89..c33a4be 100755 --- a/scripts/open +++ b/scripts/open @@ -5,16 +5,26 @@ # 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. +# https:// and opens it in local web browser. # use v5.14; $_ = shift; +$| = 1; # markdown file -if (/\.md$/ && `which pandoc` && `which lynx`) { - `pandoc -s -o /tmp/index.html $_ 2>/dev/null`; - system 'lynx', '/tmp/index.html'; - exit +if (/\.md$/) { + 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 @@ -22,7 +32,7 @@ if (-r $_) { `which xdg-open` && exec 'xdg-open', $_; `which /usr/bin/open` && exec '/usr/bin/open', $_; `which explorer.exe` && exec 'explorer.exe', $_; - print "Unable to open file: $_"; + say "unable to open file: $_"; exit 1; } @@ -30,8 +40,8 @@ if (-r $_) { 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; + system 'gh', 'repo', 'view','--web'; + exit; } } @@ -44,4 +54,4 @@ m,^http, or s,^,https://,; my $chrome = '/System/Applications/Google\ Chrome.app'; `which $chrome` && exec "$chrome", "$_"; -print "Unable to determine how to open $_\n"; +say "unable to determine how to open $_"; From e81714d23a5832e6dfbd91ec95e97d39aa68b8bd Mon Sep 17 00:00:00 2001 From: rwxrob Date: Sat, 19 Feb 2022 01:56:36 -0500 Subject: [PATCH 16/64] Add more installation stuff --- install/ubuntu/install-most-stuff-with-apt | 3 ++- install/ubuntu/install-neo | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 install/ubuntu/install-neo diff --git a/install/ubuntu/install-most-stuff-with-apt b/install/ubuntu/install-most-stuff-with-apt index df497af..6ba3ace 100755 --- a/install/ubuntu/install-most-stuff-with-apt +++ b/install/ubuntu/install-most-stuff-with-apt @@ -1,3 +1,4 @@ #!/bin/sh -sudo apt install nmap jq pcregrep lynx make uidmap +sudo apt install nmap jq pcregrep lynx make uidmap ruby weechat-curses python-is-python3 libcurses-perl figlet cmatrix build-essential libncurses-dev autoconf +sudo cpan -I Term::Animation diff --git a/install/ubuntu/install-neo b/install/ubuntu/install-neo new file mode 100755 index 0000000..9a52e12 --- /dev/null +++ b/install/ubuntu/install-neo @@ -0,0 +1,6 @@ +#!/bin/sh +clone st3w/neo +./autogen.sh +./configure +make +sudo make install From 06582fa8389862f8233ce20ff2eedaf2a2d1c6e8 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Sat, 19 Feb 2022 02:00:06 -0500 Subject: [PATCH 17/64] Drop wsl2 specific install stuff --- install/wsl2/README.md | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 install/wsl2/README.md diff --git a/install/wsl2/README.md b/install/wsl2/README.md deleted file mode 100644 index 44e1531..0000000 --- a/install/wsl2/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Linux Supersystem for Windows (WSL2) - -This is for specific stuff for WSL2 that is not already covered by -Ubuntu. From 7a3dcf8129a541c35a622274b95f125736429e85 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Sat, 19 Feb 2022 19:05:55 -0500 Subject: [PATCH 18/64] Fix location of pdfs --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index a40cb93..bdb6d1f 100644 --- a/.bashrc +++ b/.bashrc @@ -37,7 +37,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" From b8555619dfa14195fc3bddcfec356d562c4c9e39 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Sat, 19 Feb 2022 19:06:23 -0500 Subject: [PATCH 19/64] Add neo --- .bashrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.bashrc b/.bashrc index bdb6d1f..ee35790 100644 --- a/.bashrc +++ b/.bashrc @@ -233,6 +233,7 @@ alias coin="clip '(yes|no)'" alias grep="pcregrep" alias top=bashtop alias iam=live +alias neo="neo -D -c gold" _have vim && alias vi=vim From 93ef87861fa3717ba04a1b1b3c81c0e6d8b4f097 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Sat, 19 Feb 2022 19:07:36 -0500 Subject: [PATCH 20/64] Cleanup bashrc --- .bashrc | 29 +++-------------------------- vim/.vimrc | 3 +++ 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/.bashrc b/.bashrc index ee35790..db4c476 100644 --- a/.bashrc +++ b/.bashrc @@ -261,15 +261,15 @@ new-from() { [[ ! -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" + gh repo create -p "$template" --private "$name" cd "$name" || return 1 } -new-cmdbox() { new-from rwxrob/template-cmdbox "cmdbox-$1"; } +new-bonzai() { new-from rwxrob/bonzai-template "bonzai-$1"; } new-cmd() { new-from rwxrob/template-bash-command "cmd-$1"; } 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 @@ -325,26 +325,3 @@ _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 diff --git a/vim/.vimrc b/vim/.vimrc index 2909829..4a5eb71 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -27,6 +27,9 @@ set tabstop=2 "####################################################################### +" disable visual bell (also disable in .inputrc) +set t_vb= + let mapleader="," set softtabstop=2 From 4e09c09a5ad52442c79b2cfffc85d2284e3a0bd1 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 22 Feb 2022 00:30:12 -0500 Subject: [PATCH 21/64] Add 2 more spaces to fix gh issues --- tmux/.tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index bacaeae..ff1b1e9 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -55,7 +55,7 @@ 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 +bind c new-window \; split-window -h \; select-pane -t 2 \; resize-pane -x 21 \; send "blankpane" Enter \; select-pane -t 1 # avoid cursor movement messing with resize set -g repeat-time 200 From fa2565ace49f121804c20d862f3310cf14eb9d04 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 18:04:03 -0500 Subject: [PATCH 22/64] Add fmttable --- scripts/fmttable | 430 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 430 insertions(+) create mode 100755 scripts/fmttable diff --git a/scripts/fmttable b/scripts/fmttable new file mode 100755 index 0000000..1b43b2c --- /dev/null +++ b/scripts/fmttable @@ -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 Date: Tue, 1 Mar 2022 18:04:20 -0500 Subject: [PATCH 23/64] Add goprintasjson --- scripts/goprintasjson | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/goprintasjson diff --git a/scripts/goprintasjson b/scripts/goprintasjson new file mode 100755 index 0000000..3527a08 --- /dev/null +++ b/scripts/goprintasjson @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +read -r name + +echo " +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)} + +// Print implements PrintAsJSON. +func (s $name) Print() { fmt.Println(s.JSON()) } + +// Log implements PrintAsJSON. +func (s $name) Log() { log.Print(s.JSON()) } +" From 97b56a17abb31f210aa5335399a95edfe7f94cc7 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 18:04:52 -0500 Subject: [PATCH 24/64] Change htitle to go comments by default --- scripts/htitle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/htitle b/scripts/htitle index 67b7038..9189e34 100755 --- a/scripts/htitle +++ b/scripts/htitle @@ -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 "$@" From a0fea92f1ebaa3646fa8206e9890803d3cf523df Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 18:05:27 -0500 Subject: [PATCH 25/64] Use latest go build --- scripts/go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/go b/scripts/go index e764e01..432b2b0 100755 --- a/scripts/go +++ b/scripts/go @@ -1,3 +1,4 @@ #!/bin/sh -exec "$GOBIN/go1.18beta2" "$@" +exec /home/rwxrob/Repos/github.com/golang/go/bin/go "$@" +#exec "$GOBIN/go1.18beta2" "$@" From 5f7958c652e886d5d2ad3e1bb2a441e51c344bac Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 18:05:57 -0500 Subject: [PATCH 26/64] Add raid script --- scripts/raid | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 scripts/raid diff --git a/scripts/raid b/scripts/raid new file mode 100755 index 0000000..174876f --- /dev/null +++ b/scripts/raid @@ -0,0 +1,3 @@ +#!/bin/sh +#open "https://twitch.tv/$1" +chat /msg "$TWITCH_USER" /raid "$1" From 86e1f33de18502078ebfdf1da9e88da88f02415e Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 18:06:09 -0500 Subject: [PATCH 27/64] Add host script --- scripts/host | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 scripts/host diff --git a/scripts/host b/scripts/host new file mode 100755 index 0000000..d3d125e --- /dev/null +++ b/scripts/host @@ -0,0 +1,3 @@ +#!/bin/sh +#open "https://twitch.tv/$1" +chat /msg "$TWITCH_USER" /host "$1" From c0ed0894bb7f7d4375ad6807008d626c0b6f6eaf Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 18:06:34 -0500 Subject: [PATCH 28/64] Remove google chat spam --- scripts/google | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/google b/scripts/google index 868c262..022b923 100755 --- a/scripts/google +++ b/scripts/google @@ -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=$*" From bbac4593e930a319352d03bb4864d2c3914c1195 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 18:07:21 -0500 Subject: [PATCH 29/64] Add foo and ./foo to completion in bashrc --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index db4c476..cb5dd16 100644 --- a/.bashrc +++ b/.bashrc @@ -296,7 +296,7 @@ clone() { owncomp=( pdf md zet yt gl auth pomo config live iam sshkey ws x clip - ./build build b ./k8sapp k8sapp ./setup ./cmd run ./run + ./build build b ./k8sapp k8sapp ./setup ./cmd run ./run foo ./foo ) for i in "${owncomp[@]}"; do complete -C "$i" "$i"; done From 9bc445fdd802157df6d5622080759fcb8e000e36 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 18:07:50 -0500 Subject: [PATCH 30/64] Add install-ansible --- install/ubuntu/install-ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/ubuntu/install-ansible b/install/ubuntu/install-ansible index 4dfdaf5..70eb083 100755 --- a/install/ubuntu/install-ansible +++ b/install/ubuntu/install-ansible @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh sudo add-apt-repository --yes --update ppa:ansible/ansible sudo apt install ansible From 57a598bdc603bfe00ea5e5fef9cc98c1c3ac5618 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 18:08:22 -0500 Subject: [PATCH 31/64] Add entr to ubuntu install --- install/ubuntu/install-most-stuff-with-apt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/ubuntu/install-most-stuff-with-apt b/install/ubuntu/install-most-stuff-with-apt index 6ba3ace..cff46e2 100755 --- a/install/ubuntu/install-most-stuff-with-apt +++ b/install/ubuntu/install-most-stuff-with-apt @@ -1,4 +1,4 @@ #!/bin/sh -sudo apt install nmap jq pcregrep lynx make uidmap ruby weechat-curses python-is-python3 libcurses-perl figlet cmatrix build-essential libncurses-dev autoconf +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 From 13fcefc5b9a39fbb848f3931ed599c98249a8c9c Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 18:08:48 -0500 Subject: [PATCH 32/64] Remove mistake scripts empty dir --- scripts/scripts | 1 - 1 file changed, 1 deletion(-) delete mode 120000 scripts/scripts diff --git a/scripts/scripts b/scripts/scripts deleted file mode 120000 index 91b7e5e..0000000 --- a/scripts/scripts +++ /dev/null @@ -1 +0,0 @@ -/Users/rmuhlest/repos/github.com/rwxrob/dot/scripts \ No newline at end of file From 76232e0cc9f9dcdc3a42199f18c5587afacc1484 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 18:09:51 -0500 Subject: [PATCH 33/64] Tweak tmux settings for more 81 cols --- tmux/.tmux-live.conf | 2 +- tmux/.tmux.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tmux/.tmux-live.conf b/tmux/.tmux-live.conf index be4182d..464a3db 100644 --- a/tmux/.tmux-live.conf +++ b/tmux/.tmux-live.conf @@ -12,7 +12,7 @@ set -g status-interval 1 set -g status-bg default set -g status-justify centre -set -g status-right "#(pomo) " +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 diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index ff1b1e9..44d834f 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -55,7 +55,7 @@ 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 21 \; send "blankpane" Enter \; select-pane -t 1 +bind c new-window \; split-window -h \; select-pane -t 2 \; resize-pane -x 18 \; send "blankpane" Enter \; select-pane -t 1 # avoid cursor movement messing with resize set -g repeat-time 200 From d61ca296e223d815758a2a6f68fa53d48753fe08 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 18:10:45 -0500 Subject: [PATCH 34/64] Disable vim-polyglot, add pegn-pegn-syntax --- vim/.vimrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vim/.vimrc b/vim/.vimrc index 4a5eb71..f05d67c 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -213,8 +213,9 @@ if filereadable(expand("~/.vim/autoload/plug.vim")) " github.com/junegunn/vim-plug call plug#begin('~/.local/share/vim/plugins') - Plug 'sheerun/vim-polyglot' + "Plug 'sheerun/vim-polyglot' Plug 'vim-pandoc/vim-pandoc' + Plug 'pegn/pegn-syntax' Plug 'rwxrob/vim-pandoc-syntax-simple' Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } Plug 'tpope/vim-fugitive' From 2e1b0015eafd1c149ab37f4fc299fa3fb43bdbf3 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 21:11:19 -0500 Subject: [PATCH 35/64] Add more to goprintasjson --- scripts/goprintasjson | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/goprintasjson b/scripts/goprintasjson index 3527a08..237dc20 100755 --- a/scripts/goprintasjson +++ b/scripts/goprintasjson @@ -3,6 +3,9 @@ read -r name echo " + +// ---------------------------- PrintAsJSON --------------------------- + func (s $name) MarshalJSON() ([]byte, error) { buf := "" // TODO @@ -11,6 +14,7 @@ func (s $name) MarshalJSON() ([]byte, error) { // 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)} // Print implements PrintAsJSON. func (s $name) Print() { fmt.Println(s.JSON()) } From 8a75402557138ca6689ab84430f8acff6b1ad26d Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 1 Mar 2022 21:24:27 -0500 Subject: [PATCH 36/64] Add String to goprintasstring --- scripts/goprintasjson | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/goprintasjson b/scripts/goprintasjson index 237dc20..0da482a 100755 --- a/scripts/goprintasjson +++ b/scripts/goprintasjson @@ -6,18 +6,21 @@ echo " // ---------------------------- PrintAsJSON --------------------------- -func (s $name) MarshalJSON() ([]byte, error) { +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)} +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()) } +func (s *$name) Print() { fmt.Println(s.JSON()) } // Log implements PrintAsJSON. func (s $name) Log() { log.Print(s.JSON()) } From 540a0c76cf0ab0b31515f688ff6c4f13bb4f1bf1 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Sun, 6 Mar 2022 15:01:21 -0500 Subject: [PATCH 37/64] Add gocopyright --- scripts/gocopyright | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 scripts/gocopyright diff --git a/scripts/gocopyright b/scripts/gocopyright new file mode 100755 index 0000000..bd4c47d --- /dev/null +++ b/scripts/gocopyright @@ -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 From faef752606ed41bd6d2512b25471fc45b652fc37 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Sun, 6 Mar 2022 17:31:05 -0500 Subject: [PATCH 38/64] Add underconstruction vim filter --- scripts/underconstruction | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 scripts/underconstruction diff --git a/scripts/underconstruction b/scripts/underconstruction new file mode 100755 index 0000000..2f9bc4b --- /dev/null +++ b/scripts/underconstruction @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +echo '🚧 *under construction* 🚧' From b588d64fb42493089919f98e4db832b0ed8384a7 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Sun, 6 Mar 2022 18:09:46 -0500 Subject: [PATCH 39/64] Add isosec and -boost to marquee --- scripts/countdown | 2 +- scripts/marquee | 7 ++++--- scripts/sec2dur | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/countdown b/scripts/countdown index 1ce1bb3..a22bab5 100755 --- a/scripts/countdown +++ b/scripts/countdown @@ -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" diff --git a/scripts/marquee b/scripts/marquee index 0b72d74..158dbdd 100755 --- a/scripts/marquee +++ b/scripts/marquee @@ -16,7 +16,8 @@ marquee() { pomo="$(pomo)" #mode="$(iam mode emoji)" zet="zet:$(zet current)" - time="$(date +"%A, %B %-e, %Y, %-H:%M %Z%0z")" + 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") @@ -27,13 +28,13 @@ marquee() { topicremain=$(( $(tput cols) - ${#topicbarb} )) timeremain=$(( $(tput cols) - ${#timebarb} )) topicspace=$(( topicremain - ${#mode} - ${#zet})) - timespace=$(( timeremain - ${#mode} - ${#zet} - ${#tilboost})) + 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 [boost: $tilboost]" + echo "$timebarb ($isosec) [boost: $tilboost]" #fi } diff --git a/scripts/sec2dur b/scripts/sec2dur index df19f99..9fab2c1 100755 --- a/scripts/sec2dur +++ b/scripts/sec2dur @@ -1,10 +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)) (( seconds -= (days*86400) )) hours=$((seconds/3600)) (( seconds -= (hours*3600) )) minutes=$((seconds/60)) (( seconds -= (minutes*60) )) -printf "%i.%02i.%02i.%02i" "$days" "$hours" "$minutes" "$seconds" +printf "%s%i.%02i.%02i.%02i" "$minus" "$days" "$hours" "$minutes" "$seconds" From c2a0b84a05a5601b6c2ac7765d197b301343ac95 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Sun, 6 Mar 2022 20:32:17 -0500 Subject: [PATCH 40/64] Add goimethods for interface->methods in vim --- scripts/goimethods | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 scripts/goimethods diff --git a/scripts/goimethods b/scripts/goimethods new file mode 100755 index 0000000..890cabd --- /dev/null +++ b/scripts/goimethods @@ -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 + + From 06b9a0665fa1a49cb42b37e00a07d1df87b26458 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Wed, 9 Mar 2022 23:22:33 -0500 Subject: [PATCH 41/64] Add gologtestoutput --- scripts/gologtestoutput | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 scripts/gologtestoutput diff --git a/scripts/gologtestoutput b/scripts/gologtestoutput new file mode 100755 index 0000000..2b61267 --- /dev/null +++ b/scripts/gologtestoutput @@ -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()) +' From 8fb6c24296ac14a2671bcb428741b018ecac93a1 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 15 Mar 2022 21:58:28 -0400 Subject: [PATCH 42/64] Add sudo to install-kubectl --- install/ubuntu/install-kubectl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/ubuntu/install-kubectl b/install/ubuntu/install-kubectl index 8045fe7..c061fa7 100755 --- a/install/ubuntu/install-kubectl +++ b/install/ubuntu/install-kubectl @@ -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 From e963d2c812009a123261078d43e192f5defb491f Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 15 Mar 2022 23:51:06 -0400 Subject: [PATCH 43/64] Try vim without line numbers --- vim/.vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index f05d67c..688e435 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -14,8 +14,8 @@ set autoindent " 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 From 24fbc80ad4cacb27dca251f1225b10680a3557bc Mon Sep 17 00:00:00 2001 From: rwxrob Date: Sun, 20 Mar 2022 19:16:56 -0400 Subject: [PATCH 44/64] Add better vim visuals for scan.X work --- vim/.vimrc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 688e435..172460a 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -54,12 +54,11 @@ if v:version >= 800 endif " mark trailing spaces as errors -if has("match") - match ErrorMsg '\s\+$' -endif +match WildMenu '\s\+$' " enough for line numbers + gutter within 80 standard set textwidth=72 +set colorcolumn=73 " replace tabs with spaces automatically set expandtab @@ -213,7 +212,7 @@ if filereadable(expand("~/.vim/autoload/plug.vim")) " github.com/junegunn/vim-plug call plug#begin('~/.local/share/vim/plugins') - "Plug 'sheerun/vim-polyglot' + Plug 'frazrepo/vim-rainbow' Plug 'vim-pandoc/vim-pandoc' Plug 'pegn/pegn-syntax' Plug 'rwxrob/vim-pandoc-syntax-simple' @@ -223,6 +222,9 @@ if filereadable(expand("~/.vim/autoload/plug.vim")) Plug 'morhetz/gruvbox' call plug#end() + " rainbox + let g:rainbow_active = 1 + " terraform let g:terraform_fmt_on_save = 1 From 9b2c5dd4d85200485fd7318476a1acb05ab8fa81 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Sun, 20 Mar 2022 19:41:27 -0400 Subject: [PATCH 45/64] Soften color for trailing space --- vim/.vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 172460a..5b8155d 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -54,11 +54,11 @@ if v:version >= 800 endif " mark trailing spaces as errors -match WildMenu '\s\+$' +match IncSearch '\s\+$' " enough for line numbers + gutter within 80 standard set textwidth=72 -set colorcolumn=73 +"set colorcolumn=73 " replace tabs with spaces automatically set expandtab From e00bcd96ed6e52cdcc7590296fb4482e0eb7b4ff Mon Sep 17 00:00:00 2001 From: rwxrob Date: Thu, 24 Mar 2022 03:02:18 -0400 Subject: [PATCH 46/64] Updates for commands --- .bashrc | 4 ++-- go.mod | 3 +++ go.work | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 go.mod create mode 100644 go.work diff --git a/.bashrc b/.bashrc index cb5dd16..7462719 100644 --- a/.bashrc +++ b/.bashrc @@ -265,7 +265,7 @@ new-from() { cd "$name" || return 1 } -new-bonzai() { new-from rwxrob/bonzai-template "bonzai-$1"; } +new-bonzai() { new-from rwxrob/foo "$1"; } new-cmd() { new-from rwxrob/template-bash-command "cmd-$1"; } cdz () { cd $(zet get "$@"); } @@ -296,7 +296,7 @@ clone() { owncomp=( pdf md zet yt gl auth pomo config live iam sshkey ws x clip - ./build build b ./k8sapp k8sapp ./setup ./cmd run ./run foo ./foo + ./build build b ./k8sapp k8sapp ./setup ./cmd run ./run foo ./foo cmd ./cmd ) for i in "${owncomp[@]}"; do complete -C "$i" "$i"; done diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..0dafadd --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/rwxrob/dot + +go 1.18 diff --git a/go.work b/go.work new file mode 100644 index 0000000..4567d9d --- /dev/null +++ b/go.work @@ -0,0 +1,3 @@ +go 1.18 + +use . From 8c3d094c50dbda4eb10f97de04f9684ac41cfae3 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Thu, 24 Mar 2022 03:09:11 -0400 Subject: [PATCH 47/64] Fix new-bonzai --- .bashrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.bashrc b/.bashrc index 7462719..174f257 100644 --- a/.bashrc +++ b/.bashrc @@ -262,6 +262,7 @@ new-from() { cd "$GHREPOS" || return 1 [[ -e "$name" ]] && echo "exists: $name" && return 1 gh repo create -p "$template" --private "$name" + gh repo clone "$name" cd "$name" || return 1 } From 1ac019664f010d1632db8fe15069de5c60318ea5 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Thu, 24 Mar 2022 03:09:31 -0400 Subject: [PATCH 48/64] Add if err != nil, etc --- vim/.vimrc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 5b8155d..9aa4650 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -222,8 +222,9 @@ if filereadable(expand("~/.vim/autoload/plug.vim")) Plug 'morhetz/gruvbox' call plug#end() - " rainbox - let g:rainbow_active = 1 + " rainbow + " FIXME: only do this for non-pandoc file types + "let g:rainbow_active=1 " terraform let g:terraform_fmt_on_save = 1 @@ -262,6 +263,7 @@ if filereadable(expand("~/.vim/autoload/plug.vim")) au FileType go nmap i :GoInfo au FileType go nmap l :GoMetaLinter! au FileType go nmap m ilog.Print("made") + au FileType go nmap n iif err != nil {return err} else autocmd vimleavepre *.go !gofmt -w % " backup if fatih fails endif @@ -346,6 +348,7 @@ function! 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 @@ -386,3 +389,4 @@ noremap set rtp^=~/.vimpersonal set rtp^=~/.vimprivate set rtp^=~/.vimwork + From 6e36ab3baf1734270cbaa8076b8139c20bbae4e4 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Thu, 24 Mar 2022 06:48:39 -0400 Subject: [PATCH 49/64] Update cmds completion --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 174f257..2472f07 100644 --- a/.bashrc +++ b/.bashrc @@ -297,7 +297,7 @@ clone() { owncomp=( pdf md zet yt gl auth pomo config live iam sshkey ws x clip - ./build build b ./k8sapp k8sapp ./setup ./cmd run ./run foo ./foo cmd ./cmd + ./build build b ./k8sapp k8sapp ./setup ./cmd run ./run foo ./foo cmds ./cmds ) for i in "${owncomp[@]}"; do complete -C "$i" "$i"; done From f2851cf3e05946ce31700ddae7544926fa91faa8 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Thu, 24 Mar 2022 06:51:40 -0400 Subject: [PATCH 50/64] Update z completion --- .bashrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 2472f07..3fe388d 100644 --- a/.bashrc +++ b/.bashrc @@ -296,8 +296,9 @@ clone() { # ------------- source external dependencies / completion ------------ owncomp=( - pdf md zet yt gl auth pomo config live iam sshkey ws x clip - ./build build b ./k8sapp k8sapp ./setup ./cmd run ./run foo ./foo cmds ./cmds + pdf md zet 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 ) for i in "${owncomp[@]}"; do complete -C "$i" "$i"; done From 2fd0641ae05653546786eef12c763cba21e925d6 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Fri, 25 Mar 2022 07:01:34 -0400 Subject: [PATCH 51/64] Add bonzai to tab completion --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 3fe388d..bfd0427 100644 --- a/.bashrc +++ b/.bashrc @@ -298,7 +298,7 @@ clone() { owncomp=( pdf md zet 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 + foo ./foo cmds ./cmds z bonzai ) for i in "${owncomp[@]}"; do complete -C "$i" "$i"; done From 51c7f2bedcd511c20d1edc5496ce064092c013ca Mon Sep 17 00:00:00 2001 From: rwxrob Date: Mon, 28 Mar 2022 16:31:57 -0400 Subject: [PATCH 52/64] Make new-from --public instead --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index bfd0427..2d57ab0 100644 --- a/.bashrc +++ b/.bashrc @@ -261,7 +261,7 @@ new-from() { [[ ! -d "$GHREPOS" ]] && echo "Not found: $GHREPOS" && return 1 cd "$GHREPOS" || return 1 [[ -e "$name" ]] && echo "exists: $name" && return 1 - gh repo create -p "$template" --private "$name" + gh repo create -p "$template" --public "$name" gh repo clone "$name" cd "$name" || return 1 } From f5af959ee103d33531b0cb4f722b5ff45eae0226 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Wed, 30 Mar 2022 17:04:08 -0400 Subject: [PATCH 53/64] Disable spellcapcheck in vim --- vim/.vimrc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vim/.vimrc b/vim/.vimrc index 9aa4650..bdf3973 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -72,6 +72,9 @@ set norelativenumber " turn on default spell checking "set spell +" disable spellcapcheck +set spc= + " more risky, but cleaner set nobackup set noswapfile @@ -195,6 +198,7 @@ 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 yaml hi yamlBlockMappingKey ctermfg=NONE au FileType bash set sw=2 au FileType c set sw=8 @@ -220,6 +224,7 @@ if filereadable(expand("~/.vim/autoload/plug.vim")) Plug 'tpope/vim-fugitive' Plug 'hashivim/vim-terraform' Plug 'morhetz/gruvbox' + Plug 'mrk21/yaml-vim' call plug#end() " rainbow @@ -324,7 +329,8 @@ 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 "fix bork bash detection if has("eval") " vim-tiny detection From 62b62da12ecf306b3e480aaf8004f808ba8bf154 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Wed, 20 Apr 2022 22:30:45 -0400 Subject: [PATCH 54/64] Move isonan to bonzai z --- scripts/isonan | 2 -- 1 file changed, 2 deletions(-) delete mode 100755 scripts/isonan diff --git a/scripts/isonan b/scripts/isonan deleted file mode 100755 index d5d15a4..0000000 --- a/scripts/isonan +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec date -u +%Y%m%d%H%M%S%N "$@" From 9605378d5fe9e0c9258e70c94e95e6d7c88ce384 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 10 May 2022 13:09:01 -0400 Subject: [PATCH 55/64] Add latestghrel snippet --- snippets/bash/latestghrel | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 snippets/bash/latestghrel diff --git a/snippets/bash/latestghrel b/snippets/bash/latestghrel new file mode 100644 index 0000000..31c36b5 --- /dev/null +++ b/snippets/bash/latestghrel @@ -0,0 +1,3 @@ +user="" +repo="" +latest=$(curl -sSL "https://api.github.com/repos/$user/$repo/releases/latest" | jq -r .name) From 1715fde39d814435938e2bb5a1bc046043b98344 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Wed, 11 May 2022 01:44:13 -0400 Subject: [PATCH 56/64] Add install-docker-compose --- install/ubuntu/install-docker-compose | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 install/ubuntu/install-docker-compose diff --git a/install/ubuntu/install-docker-compose b/install/ubuntu/install-docker-compose new file mode 100755 index 0000000..61bb573 --- /dev/null +++ b/install/ubuntu/install-docker-compose @@ -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" From 845f7486043724d8f7d78021f4bed55a5d9f81f3 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Wed, 25 May 2022 22:45:11 -0400 Subject: [PATCH 57/64] Remove old yq completion --- .bashrc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 2d57ab0..8721f8e 100644 --- a/.bashrc +++ b/.bashrc @@ -59,6 +59,7 @@ export CGO_ENABLED=0 export PYTHONDONTWRITEBYTECODE=2 # fucking shit-for-brains var name export LC_COLLATE=C export CFLAGS="-Wall -Wextra -Werror -O0 -g -fsanitize=address -fno-omit-frame-pointer -finstrument-functions" + export LESS_TERMCAP_mb="" # magenta export LESS_TERMCAP_md="" # yellow export LESS_TERMCAP_me="" # "0m" @@ -66,6 +67,7 @@ export LESS_TERMCAP_se="" # "0m" export LESS_TERMCAP_so="" # blue export LESS_TERMCAP_ue="" # "0m" export LESS_TERMCAP_us="" # underline + export ANSIBLE_INVENTORY="$HOME/.config/ansible/ansible_hosts" export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock @@ -224,6 +226,7 @@ alias ls='ls -h --color=auto' alias free='free -h' 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 @@ -239,6 +242,12 @@ _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 @@ -266,7 +275,7 @@ new-from() { cd "$name" || return 1 } -new-bonzai() { new-from rwxrob/foo "$1"; } +new-bonzai() { new-from rwxrob/bonzai-example "$1"; } new-cmd() { new-from rwxrob/template-bash-command "cmd-$1"; } cdz () { cd $(zet get "$@"); } @@ -311,7 +320,6 @@ _have spotify && . <(spotify completion bash 2>/dev/null) _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) From 79cbeb1ef03002763033ea8eb413dfafacffe270 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Wed, 25 May 2022 22:46:11 -0400 Subject: [PATCH 58/64] Add yaml 4 space indent, lose bad mod --- vim/.vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/.vimrc b/vim/.vimrc index bdf3973..88fdc40 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -199,6 +199,7 @@ 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 yaml hi yamlBlockMappingKey ctermfg=NONE +au FileType yaml set sw=4 au FileType bash set sw=2 au FileType c set sw=8 @@ -224,7 +225,6 @@ if filereadable(expand("~/.vim/autoload/plug.vim")) Plug 'tpope/vim-fugitive' Plug 'hashivim/vim-terraform' Plug 'morhetz/gruvbox' - Plug 'mrk21/yaml-vim' call plug#end() " rainbow From f621e33a8558bf47e1d2e066c93a6ae5316ec51b Mon Sep 17 00:00:00 2001 From: rwxrob Date: Tue, 14 Jun 2022 14:56:28 -0400 Subject: [PATCH 59/64] Add install-minikube --- install/ubuntu/install-minikube | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 install/ubuntu/install-minikube diff --git a/install/ubuntu/install-minikube b/install/ubuntu/install-minikube new file mode 100755 index 0000000..52fa8ed --- /dev/null +++ b/install/ubuntu/install-minikube @@ -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/ From 04a55646063227954ef700ec84e8ed5776829afd Mon Sep 17 00:00:00 2001 From: rwxrob Date: Wed, 15 Jun 2022 17:02:51 -0400 Subject: [PATCH 60/64] Add OPA install-conftest --- install/ubuntu/install-conftest | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 install/ubuntu/install-conftest diff --git a/install/ubuntu/install-conftest b/install/ubuntu/install-conftest new file mode 100755 index 0000000..4caa83b --- /dev/null +++ b/install/ubuntu/install-conftest @@ -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" From 6d153fd11a363304c7cf4536fe7e34fd5ee62d42 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Fri, 17 Jun 2022 18:32:04 +0000 Subject: [PATCH 61/64] Lose the go wrapper --- scripts/go | 4 ---- 1 file changed, 4 deletions(-) delete mode 100755 scripts/go diff --git a/scripts/go b/scripts/go deleted file mode 100755 index 432b2b0..0000000 --- a/scripts/go +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -exec /home/rwxrob/Repos/github.com/golang/go/bin/go "$@" -#exec "$GOBIN/go1.18beta2" "$@" - From a103cfd636009ce956bad610547ca263991e7669 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Fri, 17 Jun 2022 18:32:33 +0000 Subject: [PATCH 62/64] Update to install 1.18 go by default --- install/ubuntu/install-go | 72 +++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/install/ubuntu/install-go b/install/ubuntu/install-go index 79ec981..8b23ad2 100755 --- a/install/ubuntu/install-go +++ b/install/ubuntu/install-go @@ -1,33 +1,39 @@ -#!/usr/bin/env bash -set -e - -install_17() { - cd "$(mktemp -d)" - - os=linux - arch=amd64 - - file=$(curl -sSL "https://golang.org/dl/?mode=json" \ - | jq -r '.[0].files[] - | select(.os == "'"$os"'") - | select(.arch == "'"$arch"'") - | .filename') - - curl -sSLO \ - -H "Accept: application/vnd.github.v3+json" \ - "https://dl.google.com/go/$file" - - sudo tar xzf "$file" -C /usr/local/ - - echo "Make sure /usr/local/go/bin is in PATH" -} - -upgrade_18() { - /usr/local/go/bin/go install golang.org/dl/go1.18beta2@latest - "$GOBIN/go1.18beta2" download - go install golang.org/x/tools/gopls@latest -} - -#install_17 -upgrade_18 - +# #!/usr/bin/env bash + +# 1.18 is the new default +sudo apt-get -y install golang + +# +# +# set -e +# +# install_17() { +# cd "$(mktemp -d)" +# +# os=linux +# arch=amd64 +# +# file=$(curl -sSL "https://golang.org/dl/?mode=json" \ +# | jq -r '.[0].files[] +# | select(.os == "'"$os"'") +# | select(.arch == "'"$arch"'") +# | .filename') +# +# curl -sSLO \ +# -H "Accept: application/vnd.github.v3+json" \ +# "https://dl.google.com/go/$file" +# +# sudo tar xzf "$file" -C /usr/local/ +# +# echo "Make sure /usr/local/go/bin is in PATH" +# } +# +# upgrade_18() { +# /usr/local/go/bin/go install golang.org/dl/go1.18beta2@latest +# "$GOBIN/go1.18beta2" download +# go install golang.org/x/tools/gopls@latest +# } +# +# #install_17 +# upgrade_18 +# From 9dcec1daec96807ab9b6e4bf963b4880a46b0363 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Fri, 17 Jun 2022 20:28:45 +0000 Subject: [PATCH 63/64] Install make as dep --- scripts/fishies | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/fishies b/scripts/fishies index 9436058..7f882c4 100755 --- a/scripts/fishies +++ b/scripts/fishies @@ -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. From b7d8d72bbbaa4b66f24ad6c56346bcb10e5067c0 Mon Sep 17 00:00:00 2001 From: rwxrob Date: Fri, 17 Jun 2022 20:29:01 +0000 Subject: [PATCH 64/64] Support rootless docker --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 8721f8e..f513807 100644 --- a/.bashrc +++ b/.bashrc @@ -69,7 +69,7 @@ export LESS_TERMCAP_ue="" # "0m" export LESS_TERMCAP_us="" # underline export ANSIBLE_INVENTORY="$HOME/.config/ansible/ansible_hosts" -export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock +#export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock [[ -d /.vim/spell ]] && export VIMSPELL=("$HOME/.vim/spell/*.add")