-
Notifications
You must be signed in to change notification settings - Fork 84
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
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
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." |
There was a problem hiding this comment.
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?
# 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." |
There was a problem hiding this comment.
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 🤷
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Btw, wrong target branch, changing it now |
we've got a conflict, can you check it out? |
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.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...).