mirror of https://github.com/rwxrob/dot
Compare commits
162 Commits
Author | SHA1 | Date |
---|---|---|
|
b3a3094ae8 | 11 months ago |
|
b96b0a0d49 | 11 months ago |
|
6d1a935da4 | 11 months ago |
|
39566dc2de | 11 months ago |
|
911ff5b7b2 | 11 months ago |
|
3ce9e0cddb | 11 months ago |
|
4fe8d60f84 | 11 months ago |
|
1e711b3ba5 | 11 months ago |
|
39191e5510 | 11 months ago |
|
c3c1aa55bd | 11 months ago |
|
4ca90e4cd2 | 11 months ago |
|
1ebe66fe3b | 11 months ago |
|
9303d83b0e | 11 months ago |
|
68c07f1fca | 11 months ago |
|
1a4acb9e06 | 11 months ago |
|
065711076e | 11 months ago |
|
57d8b11812 | 11 months ago |
|
7dbb608ceb | 11 months ago |
|
1a15a37058 | 11 months ago |
|
2feee2a8eb | 11 months ago |
|
f16a017f13 | 11 months ago |
|
bf24b23c55 | 11 months ago |
|
c647f42bb9 | 11 months ago |
|
4b90c018b5 | 11 months ago |
|
93ef16d0a1 | 11 months ago |
|
80391caa89 | 11 months ago |
|
d0fb8b0ab5 | 11 months ago |
|
ac70c9b145 | 11 months ago |
|
5759cca69d | 11 months ago |
|
4462bb6c72 | 11 months ago |
|
e72a7ec520 | 12 months ago |
|
57c421081d | 12 months ago |
|
f642a8e37d | 12 months ago |
|
e133de3e8a | 12 months ago |
|
e3b9113fac | 12 months ago |
|
8b273c7c18 | 12 months ago |
|
e68876acd8 | 12 months ago |
|
5a47c61e7c | 12 months ago |
|
310bce8b81 | 12 months ago |
|
fe42bc0ff7 | 12 months ago |
|
3bea278f88 | 12 months ago |
|
40fe09bef1 | 12 months ago |
|
3b8c7509c2 | 1 year ago |
|
0ad816bb2a | 1 year ago |
|
927a189053 | 1 year ago |
|
3533e9632c | 1 year ago |
|
e3b0573a42 | 1 year ago |
|
b2a2e5511b | 1 year ago |
|
014509cda9 | 1 year ago |
|
9a2d4a059b | 1 year ago |
|
3e47f036e5 | 1 year ago |
|
77b36509de | 1 year ago |
|
b174b45b26 | 2 years ago |
|
abcafec38f | 2 years ago |
|
47a4f40356 | 2 years ago |
|
bc0b2e22f7 | 2 years ago |
|
f829dc1a2a | 2 years ago |
|
a8e2134754 | 2 years ago |
|
095790a8ad | 2 years ago |
|
a32ba3a736 | 2 years ago |
|
b715b205e0 | 2 years ago |
|
b7c634a713 | 2 years ago |
|
00a61298ca | 2 years ago |
|
65c75a037a | 2 years ago |
|
d63d9c646d | 2 years ago |
|
db2b0eeed4 | 2 years ago |
|
078fd39911 | 2 years ago |
|
9e4b0cf851 | 2 years ago |
|
8b2b83b240 | 2 years ago |
|
5eef74ee06 | 2 years ago |
|
6430e51446 | 2 years ago |
|
67c77a7cb9 | 2 years ago |
|
34af292b2c | 2 years ago |
|
92952c14af | 2 years ago |
|
8888b0f673 | 2 years ago |
|
2920fc7f0c | 2 years ago |
|
f507564997 | 2 years ago |
|
25e839ceb5 | 2 years ago |
|
8575e22bac | 2 years ago |
|
05f402a2b1 | 2 years ago |
|
4baf471968 | 2 years ago |
|
5084615ada | 2 years ago |
|
f79a0cb222 | 2 years ago |
|
4f5f198aef | 2 years ago |
|
31cd8c8356 | 2 years ago |
|
3de0bbbdcd | 2 years ago |
|
9894adf2ea | 2 years ago |
|
b51a7d0b06 | 2 years ago |
|
c6b19d0c1d | 2 years ago |
|
bcefefe02c | 2 years ago |
|
7b237b0257 | 2 years ago |
|
35160bd7aa | 2 years ago |
|
78edaeabee | 2 years ago |
|
25b330babb | 2 years ago |
|
021c372c1b | 2 years ago |
|
943fe5f91b | 2 years ago |
|
187431462b | 2 years ago |
|
c343a14d8e | 2 years ago |
|
b7d8d72bbb | 2 years ago |
|
9dcec1daec | 2 years ago |
|
a103cfd636 | 2 years ago |
|
6d153fd11a | 2 years ago |
|
04a5564606 | 2 years ago |
|
f621e33a85 | 2 years ago |
|
79cbeb1ef0 | 2 years ago |
|
845f748604 | 2 years ago |
|
1715fde39d | 2 years ago |
|
9605378d5f | 2 years ago |
|
62b62da12e | 2 years ago |
|
f5af959ee1 | 2 years ago |
|
51c7f2bedc | 2 years ago |
|
2fd0641ae0 | 2 years ago |
|
f2851cf3e0 | 2 years ago |
|
6e36ab3baf | 2 years ago |
|
1ac019664f | 2 years ago |
|
8c3d094c50 | 2 years ago |
|
e00bcd96ed | 2 years ago |
|
9b2c5dd4d8 | 2 years ago |
|
24fbc80ad4 | 2 years ago |
|
e963d2c812 | 2 years ago |
|
8fb6c24296 | 2 years ago |
|
06b9a0665f | 2 years ago |
|
c2a0b84a05 | 2 years ago |
|
b588d64fb4 | 2 years ago |
|
faef752606 | 2 years ago |
|
540a0c76cf | 2 years ago |
|
8a75402557 | 2 years ago |
|
2e1b0015ea | 2 years ago |
|
d61ca296e2 | 2 years ago |
|
76232e0cc9 | 2 years ago |
|
13fcefc5b9 | 2 years ago |
|
57a598bdc6 | 2 years ago |
|
9bc445fdd8 | 2 years ago |
|
bbac4593e9 | 2 years ago |
|
c0ed0894bb | 2 years ago |
|
86e1f33de1 | 2 years ago |
|
5f7958c652 | 2 years ago |
|
a0fea92f1e | 2 years ago |
|
97b56a17ab | 2 years ago |
|
7f6ccf61d5 | 2 years ago |
|
fa2565ace4 | 2 years ago |
|
4e09c09a5a | 2 years ago |
|
93ef87861f | 2 years ago |
|
b8555619df | 2 years ago |
|
7a3dcf8129 | 2 years ago |
|
06582fa838 | 2 years ago |
|
e81714d23a | 2 years ago |
|
48248307c3 | 2 years ago |
|
4c62ce6b30 | 2 years ago |
|
28d1ab2692 | 2 years ago |
|
403d6f5e9a | 2 years ago |
|
6e51c56f88 | 2 years ago |
|
3828b6855a | 2 years ago |
|
0552b9b86f | 2 years ago |
|
f06b53e5c5 | 2 years ago |
|
766f99ac55 | 2 years ago |
|
4a12ddfd5c | 2 years ago |
|
aeca3f6654 | 2 years ago |
|
94b8e9b737 | 2 years ago |
|
c5978faca7 | 2 years ago |
|
ae8a71ebd2 | 2 years ago |
|
109a39f7a9 | 2 years ago |
@ -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.
|
||||
|
@ -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,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
|
||||
|
@ -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
|
@ -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,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()
|
||||
}
|
@ -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
|
@ -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 "$@"
|
@ -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()) }
|
||||
"
|
@ -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
|
@ -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,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 "$@"
|
@ -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 &
|
@ -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
|
||||
|
@ -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)
|
Loading…
Reference in New Issue