8000 Added glow and fzf-thr by lap1nou · Pull Request #487 · ThePorgs/Exegol-images · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added glow and fzf-thr #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open

Added glow and fzf-thr #487

wants to merge 6 commits into from

Conversation

lap1nou
Copy link
Contributor
@lap1nou lap1nou commented Mar 29, 2025

Description

This PR add a little alias to browse The Hacker Recipes inside the terminal, it also replace variable, I was inspired by this: https://x.com/_nwodtuhs/status/1905703421652685064.

The alias make use of glow (https://github.com/charmbracelet/glow) to render Markdown inside the terminal.

image

image

Related issues

N / A

Point of attention

The glow binary size is around 6 MB.

Image are not rendered and link between Markdown file don't work yet. Also some specific Vite syntax is not rendered (callouts, etc...).

Copy link
Member
@ShutdownRepo ShutdownRepo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great idea! thank you for the pull request
here are a few change requests

Comment on lines +213 to +220
colorecho "Installing glow"
wget https://github.com/charmbracelet/glow/releases/download/v2.1.0/glow_2.1.0_Linux_x86_64.tar.gz -O /tmp/glow.tar.gz
tar -xvf /tmp/glow.tar.gz
cp glow_2.1.0_Linux_x86_64/glow /opt/tools/bin
rm -f /tmp/glow.tar.gz
rm -rf /tmp/glow_2.1.0_Linux_x86_64/
add-test-command "glow --help"
add-to-list "glow,https://github.com/charmbracelet/glow,glow is a tool to render Markdown inside the terminal."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be best to have a dynamic versioning for glow?

Comment on lines +224 to +228
# CODE-CHECK-WHITELIST=add-aliases,add-history
colorecho "Installing thr"
git -C /opt/tools/ clone https://github.com/The-Hacker-Recipes/The-Hacker-Recipes.git
add-test-command "ls /opt/tools/The-Hacker-Recipes/"
add-to-list "thr,https://www.thehacker.recipes/,THR (The Hacker Recipes) is aimed at providing technical guides on various hacking topics."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably include the "server install" in here, or an alias, that allows to actually run THR locally 🤷

Comment on lines +7 to +38
alias fzf-thr='() {
file=$(find "/opt/tools/The-Hacker-Recipes/docs/src" -type f -name "*.md" | fzf)

if [ ! -z $DC_HOST ]; then
sed -i -e "s/\$DC_HOST/$DC_HOST/g" "$file";
fi

if [ ! -z $PASSWORD ]; then
sed -i -e "s/\$PASSWORD/$PASSWORD/g" "$file";
fi

if [ ! -z $USER ]; then
sed -i -e "s/\$USER/$USER/g" "$file";
fi

if [ ! -z $NT_HASH ]; then
sed -i -e "s/\$NT_HASH/$NT_HASH/g" "$file";
fi

if [ ! -z $DOMAIN ]; then
sed -i -e "s/\$DOMAIN/$DOMAIN/g" "$file";
fi

if [ ! -z $DC_IP ]; then
sed -i -e "s/\$DC_IP/$DC_IP/g" "$file";
fi

glow -t "$file"
old_path="$PWD"
cd /opt/tools/The-Hacker-Recipes/
git restore .
cd $old_path
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't be best to have this in a thr alias file? and to set a function rather than an alias?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The brackets should be doubled, and for consistency with the rest of Exegol, the variables should be between quotes.
For instance:

if [[ ! -z "$DC_HOST" ]]; then

@ShutdownRepo ShutdownRepo added the new tool(s) This adds one or multiple tools to Exegol label Apr 21, 2025
@ShutdownRepo
Copy link
Member

Btw, wrong target branch, changing it now

@ShutdownRepo ShutdownRepo changed the base branch from main to dev April 22, 2025 08:27
@ShutdownRepo
Copy link
Member

we've got a conflict, can you check it out?

@ShutdownRepo ShutdownRepo added the waiting for info or edit Further information/edit is requested label May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new tool(s) This adds one or multiple tools to Exegol waiting for info or edit Further information/edit is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0