feat: server packages

This commit is contained in:
xeruf 2023-11-08 13:25:14 +01:00
parent a771a8f020
commit 14cfa4bf33
15 changed files with 125 additions and 10 deletions

View File

@ -1,6 +1,8 @@
curl shell/minimal
git man
zsh
bat bat
neovim neovim
man-db fd
bpytop
tree
wget

3
groups/shell/extrac Normal file
View File

@ -0,0 +1,3 @@
# Dependencies for my pve backup extraction script
vma
lzop

View File

@ -3,5 +3,4 @@ sudo
git git
tmux tmux
curl curl
man
pfetch pfetch

View File

@ -1,6 +1,5 @@
shell/basics shell/basics
tree zsh
wget
texinfo texinfo
fzf fzf
expect expect

View File

@ -19,19 +19,24 @@ dir_packages="$dir_home/packages"
highlight() { echo $2 "$1" >&2; } highlight() { echo $2 "$1" >&2; }
destress() { echo $2 "$1" >&2; } destress() { echo $2 "$1" >&2; }
# Cat a file, filtering out dos line endings and commented lines
catfile() {
cat "$@" | tr -d '\r' | sed '/^#/d'
}
# Get the content of a file or the output of its execution # Get the content of a file or the output of its execution
getcontent() { getcontent() {
for arg; do for arg; do
if test -z "$noexec" && test -x "$arg" if test -z "$noexec" && test -x "$arg"
then "$arg" then "$arg"
else cat "$arg" | tr -d '\r' else catfile "$arg"
fi fi
done done
} }
# Get available package entries for given package # Get available package entries for given package
getentries() { getentries() {
cat "$handlersfile" | tr -d '\r' | while read handler catfile "$handlersfile" | while read handler
do find "$dir_packages/$1/" -depth -type f -name "$handler*" 2>/dev/null | tac do find "$dir_packages/$1/" -depth -type f -name "$handler*" 2>/dev/null | tac
done done
} }

0
packages/bpytop/apt Normal file
View File

0
packages/bpytop/arch Normal file
View File

1
packages/fd/apt Normal file
View File

@ -0,0 +1 @@
fd-find

View File

@ -1,7 +1,8 @@
#!/bin/sh -e #!/bin/sh -e
# From https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=instalee-git # From https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=instalee-git
_pkgname='instalee' _pkgname='instalee'
cd "$(readlink /proc/$(ps -o ppid= $PPID | tr -d ' ')/cwd || $dir_home)" cd $(dirname $(dirname $(dirname "$0")))
#cd "$(readlink /proc/$(ps -o ppid= $PPID | tr -d ' ')/cwd || $dir_home)"
#cd "$(readlink /proc/$(ps -o ppid= $(ps -o ppid= $PPID) | tr -d ' ')/cwd || $dir_home)" #cd "$(readlink /proc/$(ps -o ppid= $(ps -o ppid= $PPID) | tr -d ' ')/cwd || $dir_home)"
usrdir="${pkgdir}/usr/local" usrdir="${pkgdir}/usr/local"
bin="${usrdir}/bin" bin="${usrdir}/bin"

View File

@ -0,0 +1 @@
k9s

View File

@ -0,0 +1,99 @@
# https://github.com/derailed/k9s/blob/master/plugins/flux.yaml
# move selected line to chosen resource in K9s, then:
# Shift-T (with confirmation) to toggle helm releases or kustomizations suspend and resume
# Shift-R (no confirmation) to reconcile a git source or a helm release or a kustomization
plugin:
toggle-helmrelease:
shortCut: Shift-T
confirm: true
scopes:
- helmreleases
description: Toggle to suspend or resume a HelmRelease
command: sh
background: true
args:
- -c
- "flux $([ $(kubectl get helmreleases -n $NAMESPACE $NAME -o=custom-columns=TYPE:.spec.suspend | tail -1) = \"true\" ] && echo \"resume\" || echo \"suspend\") helmrelease -n $NAMESPACE $NAME | less"
toggle-kustomization:
shortCut: Shift-T
confirm: true
scopes:
- kustomizations
description: Toggle to suspend or resume a Kustomization
command: sh
background: true
args:
- -c
- "flux $([ $(kubectl get kustomizations -n $NAMESPACE $NAME -o=custom-columns=TYPE:.spec.suspend | tail -1) = \"true\" ] && echo \"resume\" || echo \"suspend\") kustomization -n $NAMESPACE $NAME | less"
reconcile-git:
shortCut: Shift-R
confirm: false
description: Flux reconcile
scopes:
- gitrepositories
command: sh
# background: false
background: true
args:
- -c
- "flux reconcile source git -n $NAMESPACE $NAME | less"
reconcile-hr:
shortCut: Shift-R
confirm: false
description: Flux reconcile
scopes:
- helmreleases
command: sh
# background: false
background: true
args:
- -c
- "flux reconcile helmrelease -n $NAMESPACE $NAME | less"
reconcile-ks:
shortCut: Shift-R
confirm: false
description: Flux reconcile
scopes:
- kustomizations
command: sh
# background: false
background: true
args:
- -c
- "flux reconcile kustomization -n $NAMESPACE $NAME | less"
getall-ns:
shortCut: Shift-G
confirm: false
description: Get All Resources in NS
scopes:
- namespaces
command: sh
background: false
args:
- -c
- "kubectl get all -n $NAME | less"
# https://github.com/derailed/k9s/issues/1017#issuecomment-769005253
# requires https://github.com/rajatjindal/kubectl-modify-secret installed
# i.e. by krew install modify-secret
edit-secret:
shortCut: Ctrl-X
confirm: false
description: "Edit Decoded Secret"
scopes:
- secrets
command: kubectl
background: false
args:
- modify-secret
- --namespace
- $NAMESPACE
- --context
- $CONTEXT
- $NAME

2
packages/k9s-toggle/linux Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
install -D $(dirname $0)/k9s-toggle.yml ${XDG_CONFIG_HOME:-$HOME/.config}/k9s/plugin.yml

1
packages/lzop/aur Normal file
View File

@ -0,0 +1 @@

1
packages/vma/_aur Normal file
View File

@ -0,0 +1 @@
vma-git

1
packages/vma/binary Normal file
View File

@ -0,0 +1 @@
https://raw.githubusercontent.com/jancc/vma-extractor/master/vma.py