Either self-hosted or cloud, I assume many of you keep a server around for personal things. And I'm curious about the cool stuff you've got running on your personal servers.
What services do you host? Any unique stuff? Do you interact with it through ssh, termux, web server?
https://sebastiancarlos.com/microsoft-to-copyright-pi-found-to-contain-entire-arial-font-45f6a63cbf24
Hey,
As an avid CLI user, I always aimed to master non-interactive tools to perform most of my work, given that they are easy to use, create, extend, and connect.
However, I found myself dealing with software projects with many files (mostly under the yoke of corporate oppression; an ordeal which I endure to sustain myself, as most of those reading me do, and therefore I will not go further into this topic) and started to hit the limits of non-interactive tools to find and edit files. Indeed, I could go faster if I followed the temptation of monstrous IDEs, as I did in my innocent past.
I did not despair, as naturally I heard of the usefulness of interactive fuzzy finders such as fzf. After spending an afternoon evaluating the tool, I concluded that it indeed increases the complexity of my workflow. Still, this complexity is managed in a sensible way that follows the UNIX tradition.
I now ask you two general questions:
I also ask this very specific question:
#! /usr/bin/env bash
# gf: grep + fzf
# basically a wrapper for 'grep <ARGS> | fzf | cut -f 1 -d:'
# print usage on -h/--help
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "Usage: gf <grep-args>"
echo
echo "~~~ that feel when no 'gf' ~~~"
echo
echo "- Basically a wrapper for 'grep <ARGS> | fzf | cut -f 1 -d:'"
echo "- Opens fzf with grep results, and prints the selected filename(s)"
echo "- Note: As this is meant to search files, it already adds the -r flag"
echo
echo "Example:"
echo " $ nvim \`gf foobar\`"
echo " $ gf foobar | xargs nvim"
exit 0
fi
# run grep with arguments, pipe to fzf, and print the filename(s) selected
custom_grep () {
grep -E --color=always --binary-files=without-match --recursive "$@"
}
remove_color () {
sed -E 's/\x1b\[[0-9;]*[mK]//g'
}
custom_fzf () {
fzf --ansi --height ~98%
}
grep_output=$(custom_grep "$@")
if [[ "$?" -ne 0 ]]; then
exit 1
else
echo "$grep_output" | custom_fzf | remove_color | cut -f 1 -d:
fi
#! /usr/bin/env bash
# ge: grep + fzf + editor
# basically a wrapper for 'grep <ARGS> | fzf | cut -f 1 -d: | $EDITOR'
# print usage on -h/--help
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "Usage: ge <grep-args>"
echo
echo "- Basically a wrapper for 'grep <ARGS> | fzf | cut -f 1 -d: | \$EDITOR'"
echo "- Opens fzf with grep results, and edits the selected file(s)"
echo "- Note: As this is meant to search files, it already adds the -r flag"
echo "- Note: Internally, it uses the 'gf' command"
echo
echo "Example:"
echo " $ ge foobar"
exit 0
fi
# takes output from 'gf' and opens it in $EDITOR
grep_fzf_output=$(gf "$@")
if [[ -n "$grep_fzf_output" ]]; then
$EDITOR "$grep_fzf_output"
fi
Have a wonderful day, you CLI cowboys.
https://github.com/sebastiancarlos/beachpatrol
A CLI tool to replace and automate your everyday web browser. - sebastiancarlos/beachpatrol
https://github.com/sebastiancarlos/swabai
SWABAI (Wrapper for the Sway/i3/Yabai tiling window managers) - sebastiancarlos/swabai
https://github.com/sebastiancarlos/pm-jesus
PM-JESUS: "Your own, package-manager, Jesus" 🎶 (Package Manager front-end) - sebastiancarlos/pm-jesus
https://github.com/sebastiancarlos/yas-qwin?tab=readme-ov-file
YAS-QWIN (Yet Another SQL-Query Writing Interface) - GitHub - sebastiancarlos/yas-qwin: YAS-QWIN (Yet Another SQL-Query Writing Interface)
https://github.com/sebastiancarlos/beachpatrol
A CLI tool meant to replace and automate your everyday web browser. - GitHub - sebastiancarlos/beachpatrol: A CLI tool meant to replace and automate your everyday web browser.
@sebastiancarlos
@lemmy.sdf.org