Last active
June 1, 2025 04:12
-
-
Save octoshrimpy/c0f0f6262459c715b5083b5c74becdef to your computer and use it in GitHub Desktop.
Octo's term guide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| # Octo's terminal utility installer | |
| # Description: Creates a help utility and installs it to /usr/local/bin/guide | |
| set -eu # Exit on error or unset vars | |
| # Require sudo/root privileges | |
| if [ "$(id -u)" -ne 0 ]; then | |
| exec sudo "$0" "$@" | |
| fi | |
| # ASCII Logo | |
| cat << 'LOGO' | |
| _______ __ _______ __ __ | |
| | _ |────| |_.─────.─────. | _ |──.──|__.──| |─────. | |
| |. | | __| _| _ |__ --| |. |___| | | | _ | -__| | |
| |. | |____|____|_____|_____| |. | |_____|__|_____|_____| | |
| |:. 1 | |:. 1 | | |
| `───────' `───────' | |
| LOGO | |
| # Target path | |
| TARGET="/usr/local/bin/guide" | |
| # Confirm overwrite | |
| if [ -f "$TARGET" ]; then | |
| echo "Warning: $TARGET already exists. Overwrite? [y/N]" | |
| read -r answer | |
| case "$answer" in | |
| [Yy]*) ;; | |
| *) echo "Aborted."; exit 1 ;; | |
| esac | |
| fi | |
| # Write guide script | |
| tmpfile="$(mktemp)" | |
| cat > "$tmpfile" << 'EOF' | |
| #!/usr/bin/env sh | |
| # Optional self-updater | |
| if [ "${1:-}" = "update" ]; then | |
| echo "🔄 Updating Octo's Guide..." | |
| tmpfile="$(mktemp)" || { | |
| echo "❌ Failed to create temp file." | |
| exit 1 | |
| } | |
| if curl -fsSL "https://gist.githubusercontent.com/octoshrimpy/c0f0f6262459c715b5083b5c74becdef/raw" -o "$tmpfile"; then | |
| chmod 755 "$tmpfile" | |
| mv "$tmpfile" "$0" | |
| echo "✅ Guide updated successfully!" | |
| else | |
| echo "❌ Update failed. Check your internet connection or the URL." | |
| rm -f "$tmpfile" | |
| exit 1 | |
| fi | |
| exit 0 | |
| fi | |
| # Main help content | |
| echo " | |
| Welcome to Octo's Help Menu | |
| Usage: | |
| ↑/↓ - navigate | |
| q - quit | |
| ⚙️ Update this utility: | |
| guide update | |
| Or manually: | |
| curl https://gist.githubusercontent.com/octoshrimpy/c0f0f6262459c715b5083b5c74becdef/raw | sh | |
| --- | |
| 📦 yay - the package manager | |
| -s search for apps | |
| -S install app by name | |
| -R remove app by name | |
| yay - update entire system | |
| --- | |
| 💻 System Info | |
| neofetch - quick system summary | |
| inxi - detailed system info (try --help for flags) | |
| --- | |
| 📁 Directories & Navigation | |
| ls [-lahR] - list files | |
| cd - change directory | |
| pwd - print working directory | |
| mkdir <dir> - create directory | |
| rm [-rf] - remove file or directory | |
| ranger - file tree visualizer (shift-s = shell) | |
| --- | |
| 📂 File Shenanigans | |
| cp [-r] <src> <dst> - copy files or folders | |
| mv <src> <dst> - move/rename | |
| touch <file> - create empty file | |
| nano <file> - basic terminal editor | |
| micro <file> - modern editor with: | |
| ctrl-q - quit ctrl-g - help | |
| alt-g - hotkeys ctrl-s - save | |
| --- | |
| ⚡ Useful Commands | |
| clear - clears screen | |
| sudo <cmd> - run as superuser | |
| ping <ip> - test connectivity | |
| ex: 1.1.1.1, 8.8.8.8 | |
| htop - interactive system monitor | |
| shift-d - collapse tree | |
| cmd | less - scroll long output | |
| cmd | tee <file> - write output to terminal & file | |
| ctrl-C - interrupt a frozen or long command | |
| <cmd> --help - most commands offer help this way | |
| " | less | |
| EOF | |
| chmod 755 "$tmpfile" | |
| mv "$tmpfile" "$TARGET" | |
| echo "✔ Installed 'guide' to $TARGET. Run it anytime with: guide" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment