Added tools.yaml and fre.sh
This commit is contained in:
parent
64889e9013
commit
bca1293df3
4 changed files with 337 additions and 0 deletions
|
|
@ -76,6 +76,39 @@ matches:
|
||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
|
- trigger: :tfi
|
||||||
|
replace: |
|
||||||
|
---
|
||||||
|
solved:
|
||||||
|
bonus_flag:
|
||||||
|
flag:
|
||||||
|
link:
|
||||||
|
---
|
||||||
|
|
||||||
|
We find the link in Chapter 4 of the comic:
|
||||||
|
|
||||||
|
https://tficomic.io/
|
||||||
|
|
||||||
|
We visit the link (which expands to: ) and we get the bonus flag:
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
And the real challenge is:
|
||||||
|
|
||||||
|
"
|
||||||
|
|
||||||
|
"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
And we get the flag:
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
- trigger: :meat
|
- trigger: :meat
|
||||||
replace: 🥩
|
replace: 🥩
|
||||||
search_terms:
|
search_terms:
|
||||||
|
|
|
||||||
111
fre.sh
Executable file
111
fre.sh
Executable file
|
|
@ -0,0 +1,111 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
TOOLS_FILE="$(dirname "$0")/tools.yaml"
|
||||||
|
LOGFILE="$(dirname "$0")/quick-install.log"
|
||||||
|
|
||||||
|
log() { echo "[INFO] $(date '+%F %T') $*" | tee -a "$LOGFILE"; }
|
||||||
|
log_warn() { echo "[WARN] $(date '+%F %T') $*" | tee -a "$LOGFILE"; }
|
||||||
|
log_err() { echo "[ERROR] $(date '+%F %T') $*" | tee -a "$LOGFILE"; }
|
||||||
|
|
||||||
|
require_tools() {
|
||||||
|
for tool in yq gum; do
|
||||||
|
if ! command -v "$tool" &>/dev/null; then
|
||||||
|
log_err "This script requires '$tool'. Please install it first."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
get_tools_for_category() {
|
||||||
|
local category="$1"
|
||||||
|
yq e ".${category}[]" "$TOOLS_FILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
check_and_prepare_install_list() {
|
||||||
|
local category="$1"
|
||||||
|
local install_list=()
|
||||||
|
local ppas_to_add=()
|
||||||
|
|
||||||
|
# Read each item (YAML block) in the category
|
||||||
|
local length
|
||||||
|
length=$(yq e "length(.${category})" "$TOOLS_FILE")
|
||||||
|
for i in $(seq 0 $((length - 1))); do
|
||||||
|
local name ppa
|
||||||
|
name=$(yq e ".${category}[$i].name" "$TOOLS_FILE")
|
||||||
|
ppa=$(yq e ".${category}[$i].ppa // \"\"" "$TOOLS_FILE")
|
||||||
|
|
||||||
|
if ! command -v "$name" &>/dev/null; then
|
||||||
|
install_list+=("$name")
|
||||||
|
if [[ -n "$ppa" ]]; then
|
||||||
|
ppas_to_add+=("$ppa")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Remove duplicate PPAs
|
||||||
|
mapfile -t ppas_to_add < <(printf '%s\n' "${ppas_to_add[@]}" | sort -u)
|
||||||
|
|
||||||
|
echo "${install_list[*]}"
|
||||||
|
echo "${ppas_to_add[*]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
install_category() {
|
||||||
|
local category="$1"
|
||||||
|
|
||||||
|
log "Processing category: $category"
|
||||||
|
|
||||||
|
read -r -a to_install ppas < <(check_and_prepare_install_list "$category")
|
||||||
|
|
||||||
|
if [[ ${#to_install[@]} -eq 0 ]]; then
|
||||||
|
log "All tools in '$category' are already installed."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Show the user what will be installed
|
||||||
|
gum style --foreground 212 --bold "Category: $category"
|
||||||
|
gum style --foreground 99 "The following tools will be installed:"
|
||||||
|
printf '%s\n' "${to_install[@]}" | gum format
|
||||||
|
|
||||||
|
if ! gum confirm "Proceed with installing these tools?"; then
|
||||||
|
log_warn "User declined installation for category: $category"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add PPAs if any
|
||||||
|
if [[ ${#ppas[@]} -gt 0 ]]; then
|
||||||
|
for ppa in "${ppas[@]}"; do
|
||||||
|
log "Adding PPA: $ppa"
|
||||||
|
sudo add-apt-repository -y "$ppa"
|
||||||
|
done
|
||||||
|
sudo apt update
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Installing packages for category: $category"
|
||||||
|
sudo apt install -y "${to_install[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
require_tools
|
||||||
|
log "Starting tool installation from $TOOLS_FILE"
|
||||||
|
|
||||||
|
# Read all top-level categories from tools.yaml
|
||||||
|
mapfile -t categories < <(yq e 'keys | .[]' "$TOOLS_FILE")
|
||||||
|
|
||||||
|
# Let user select categories to install
|
||||||
|
selected_categories=$(gum choose --no-limit --header "Select categories to install:" "${categories[@]}")
|
||||||
|
|
||||||
|
if [[ -z "$selected_categories" ]]; then
|
||||||
|
log_warn "No categories selected. Exiting."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Loop through selected categories and install
|
||||||
|
while IFS= read -r category; do
|
||||||
|
install_category "$category"
|
||||||
|
done <<< "$selected_categories"
|
||||||
|
|
||||||
|
log "✅ All done."
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
191
tools.yaml
Normal file
191
tools.yaml
Normal file
|
|
@ -0,0 +1,191 @@
|
||||||
|
# tools.yaml
|
||||||
|
|
||||||
|
necessities:
|
||||||
|
- apt
|
||||||
|
- apt-utils
|
||||||
|
- curl
|
||||||
|
- fd-find
|
||||||
|
- fzf
|
||||||
|
- git
|
||||||
|
- gnupg
|
||||||
|
- gzip
|
||||||
|
- jq
|
||||||
|
- less
|
||||||
|
- lsb-release
|
||||||
|
- nala
|
||||||
|
- ncdu
|
||||||
|
- net-tools
|
||||||
|
- ripgrep
|
||||||
|
- sed
|
||||||
|
- sudo
|
||||||
|
- tar
|
||||||
|
- tmux
|
||||||
|
- tree
|
||||||
|
- unzip
|
||||||
|
- util-linux
|
||||||
|
- vim
|
||||||
|
- wget
|
||||||
|
- xclip
|
||||||
|
- xxd
|
||||||
|
- zoxide
|
||||||
|
- zsh
|
||||||
|
|
||||||
|
privacy:
|
||||||
|
- age
|
||||||
|
- aide
|
||||||
|
- clamav
|
||||||
|
- clamtk
|
||||||
|
- gpgv
|
||||||
|
- keepassxc
|
||||||
|
- lynis
|
||||||
|
- mat2
|
||||||
|
- mullvad-browser
|
||||||
|
- protonvpn-cli
|
||||||
|
- protonvpn-stable-release
|
||||||
|
- veracrypt
|
||||||
|
|
||||||
|
modern_cli:
|
||||||
|
- bat
|
||||||
|
- btop
|
||||||
|
- delta
|
||||||
|
- duf
|
||||||
|
- dust
|
||||||
|
- entr
|
||||||
|
- exa
|
||||||
|
- fd-find
|
||||||
|
- gitui
|
||||||
|
- helix
|
||||||
|
- micro
|
||||||
|
- most
|
||||||
|
- nnn
|
||||||
|
- procs
|
||||||
|
- silversearcher-ag
|
||||||
|
- taskwarrior
|
||||||
|
- tldr
|
||||||
|
- tig
|
||||||
|
|
||||||
|
dev:
|
||||||
|
- build-essential
|
||||||
|
- cmake
|
||||||
|
- docker
|
||||||
|
- docker-buildx
|
||||||
|
- docker-compose
|
||||||
|
- gcc-12-base
|
||||||
|
- jq
|
||||||
|
- libclang-dev
|
||||||
|
- npm
|
||||||
|
- openjdk-17-jre
|
||||||
|
- pipx
|
||||||
|
- pkg-config
|
||||||
|
- python3-pip
|
||||||
|
- shellcheck
|
||||||
|
- vite
|
||||||
|
|
||||||
|
desktop:
|
||||||
|
- alacritty
|
||||||
|
- cmatrix
|
||||||
|
- feh
|
||||||
|
- flameshot
|
||||||
|
- kitty
|
||||||
|
- neofetch
|
||||||
|
- onlyoffice-desktopeditors
|
||||||
|
- pdfsam
|
||||||
|
- redshift-gtk
|
||||||
|
- remmina
|
||||||
|
- ulauncher
|
||||||
|
- vlc
|
||||||
|
- wezterm
|
||||||
|
|
||||||
|
pentest:
|
||||||
|
- auditd
|
||||||
|
- binwalk
|
||||||
|
- fail2ban
|
||||||
|
- fping
|
||||||
|
- foremost
|
||||||
|
- gvm
|
||||||
|
- hashcat
|
||||||
|
- hashid
|
||||||
|
- john
|
||||||
|
- nmap
|
||||||
|
- steghide
|
||||||
|
- tcpdump
|
||||||
|
- testdisk
|
||||||
|
- tshark
|
||||||
|
|
||||||
|
other:
|
||||||
|
- aptitude
|
||||||
|
- deborphan
|
||||||
|
- debsums
|
||||||
|
- entr
|
||||||
|
- evolution
|
||||||
|
- iproute2
|
||||||
|
- iputils-ping
|
||||||
|
- login
|
||||||
|
- netcat-openbsd
|
||||||
|
- screen
|
||||||
|
- software-properties-common
|
||||||
|
- stow
|
||||||
|
- systemd-timesyncd
|
||||||
|
- unzip
|
||||||
|
- usbutils
|
||||||
|
- xdotool
|
||||||
|
- xsel
|
||||||
|
|
||||||
|
wishlist:
|
||||||
|
- atuin # shell history sync
|
||||||
|
- glow # markdown preview
|
||||||
|
- dua-cli # disk usage analyzer
|
||||||
|
|
||||||
|
go_tools:
|
||||||
|
- code_helper
|
||||||
|
- fabric
|
||||||
|
- glow
|
||||||
|
- gum
|
||||||
|
- hugo
|
||||||
|
- katana
|
||||||
|
- lazygit
|
||||||
|
- nuclei
|
||||||
|
- pdtm
|
||||||
|
- termshark
|
||||||
|
- to_pdf
|
||||||
|
- vhs
|
||||||
|
|
||||||
|
rust_tools:
|
||||||
|
- atac
|
||||||
|
- atuin
|
||||||
|
- bandwhich
|
||||||
|
- cargo -> rustup
|
||||||
|
- cargo-clippy -> rustup
|
||||||
|
- cargo-fmt -> rustup
|
||||||
|
- cargo-make
|
||||||
|
- cargo-miri -> rustup
|
||||||
|
- clippy-driver -> rustup
|
||||||
|
- duf
|
||||||
|
- dust
|
||||||
|
- eza
|
||||||
|
- fubar
|
||||||
|
- gping
|
||||||
|
- hexyl
|
||||||
|
- just
|
||||||
|
- makers
|
||||||
|
- navi
|
||||||
|
- onefetch
|
||||||
|
- oniux
|
||||||
|
- procs
|
||||||
|
- rls -> rustup
|
||||||
|
- rust-analyzer -> rustup
|
||||||
|
- rust-gdb -> rustup
|
||||||
|
- rust-gdbgui -> rustup
|
||||||
|
- rust-lldb -> rustup
|
||||||
|
- rust-script
|
||||||
|
- rustc -> rustup
|
||||||
|
- rustdoc -> rustup
|
||||||
|
- rustfmt -> rustup
|
||||||
|
- rustup
|
||||||
|
- sd
|
||||||
|
- taskwarrior
|
||||||
|
- tokei
|
||||||
|
- ttyper
|
||||||
|
- xh
|
||||||
|
- zellij
|
||||||
|
|
||||||
|
|
@ -54,6 +54,7 @@ alias dc=docker-compose
|
||||||
f() {
|
f() {
|
||||||
fd $1 -exec bat {} +
|
fd $1 -exec bat {} +
|
||||||
}
|
}
|
||||||
|
alias i='sudo apt install'
|
||||||
alias j='journalctl -f'
|
alias j='journalctl -f'
|
||||||
alias jj='pbpaste | jsonpp | pbcopy'
|
alias jj='pbpaste | jsonpp | pbcopy'
|
||||||
alias jjj='pbpaste | jsonpp'
|
alias jjj='pbpaste | jsonpp'
|
||||||
|
|
@ -77,6 +78,7 @@ alias vp='fd --type f --hidden --exclude .git | fzf --preview "bat {1} --color=a
|
||||||
alias vv='hx $(fzf --preview="bat {} --color=always")'
|
alias vv='hx $(fzf --preview="bat {} --color=always")'
|
||||||
alias gr='glow $(fzf --preview="bat {} --color=always")'
|
alias gr='glow $(fzf --preview="bat {} --color=always")'
|
||||||
alias xx='exit'
|
alias xx='exit'
|
||||||
|
alias eixt='exit'
|
||||||
alias yy='yazi'
|
alias yy='yazi'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue