Skip to content

Instantly share code, notes, and snippets.

@runlevel5
Last active September 12, 2025 09:36
Show Gist options
  • Save runlevel5/e6d46fede965cf40838d1cb2a5efec15 to your computer and use it in GitHub Desktop.
Save runlevel5/e6d46fede965cf40838d1cb2a5efec15 to your computer and use it in GitHub Desktop.

Revisions

  1. runlevel5 revised this gist Sep 12, 2025. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -61,4 +61,14 @@ and also override manpages path too:
    export MANPATH="$HOME/.local/share/man:"
    ```

    then reload your shell
    then reload your shell

    for fish shell (which is also written in Rust), it is a bit different but pretty much the same, simply modify `~/.config/fish/config.fish` file:

    ```
    if status is-interactive
    # Commands to run in interactive sessions can go here
    set -gx PATH $HOME/.local/uubin $PATH
    set -gx MANPATH $HOME/.local/share/man:
    end
    ```
  2. runlevel5 revised this gist Sep 12, 2025. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ Run following bash script:
    ```bash
    #!/bin/bash

    # Source and destination directories
    # For binaries
    SRC_BIN_DIR="/usr/bin"
    DEST_BIN_DIR="$HOME/.local/uubin"

    @@ -27,6 +27,7 @@ done

    echo "All uu_ files copied to $DEST_BIN_DIR with prefix stripped."

    # For manual pages
    SRC_MAN_DIR="/usr/share/man/man1"
    DEST_MAN_DIR="$HOME/.local/share/man/man1"

  3. runlevel5 revised this gist Sep 12, 2025. No changes.
  4. runlevel5 revised this gist Sep 12, 2025. 1 changed file with 34 additions and 8 deletions.
    42 changes: 34 additions & 8 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -4,28 +4,48 @@ Run following bash script:
    #!/bin/bash

    # Source and destination directories
    SRC_DIR="/usr/bin"
    DEST_DIR="$HOME/.local/uubin"
    SRC_BIN_DIR="/usr/bin"
    DEST_BIN_DIR="$HOME/.local/uubin"

    # Ensure destination directory exists
    mkdir -p "$DEST_DIR"
    mkdir -p "$DEST_BIN_DIR"

    # Find files starting with 'uu_' in /usr/bin
    find "$SRC_DIR" -type f -name 'uu_*' | while read -r src_file; do
    # Find files starting with 'uu_' in $SRC_BIN_DIR
    find "$SRC_BIN_DIR" -type f -name 'uu_*' | while read -r src_file; do
    # Get the base filename
    filename=$(basename "$src_file")

    # Strip the 'uu_' prefix
    stripped_name="${filename#uu_}"

    # Copy to destination with new name, preserving attributes
    cp -u --preserve=mode,timestamps "$src_file" "$DEST_DIR/$stripped_name"
    cp -u --preserve=mode,timestamps "$src_file" "$DEST_BIN_DIR/$stripped_name"

    # Make sure it's executable
    chmod +x "$DEST_DIR/$stripped_name"
    chmod +x "$DEST_BIN_DIR/$stripped_name"
    done

    echo "All uu_ files copied to $DEST_DIR with prefix stripped."
    echo "All uu_ files copied to $DEST_BIN_DIR with prefix stripped."

    SRC_MAN_DIR="/usr/share/man/man1"
    DEST_MAN_DIR="$HOME/.local/share/man/man1"

    # Ensure destination directory exists
    mkdir -p "$DEST_MAN_DIR"

    find "$SRC_MAN_DIR" -type f -name 'uu_*.gz' | while read -r src_file; do
    # Get the base filename
    filename=$(basename "$src_file")

    # Strip the 'uu_' prefix
    stripped_name="${filename#uu_}"

    # Copy to destination with new name, preserving attributes
    ln -sf "$SRC_MAN_DIR/$filename" "$DEST_MAN_DIR/$stripped_name"
    done

    echo "All uu_ man files linked to $DEST_MAN_DIR with prefix stripped."

    ```

    then appending the `PATH` in your rc profile, if you are using bash, it would be `~/.bashrc` or `~/.bash_profile`:
    @@ -34,4 +54,10 @@ then appending the `PATH` in your rc profile, if you are using bash, it would be
    export PATH="$HOME/.local/uubin:$PATH"
    ```

    and also override manpages path too:

    ```
    export MANPATH="$HOME/.local/share/man:"
    ```

    then reload your shell
  5. runlevel5 revised this gist Sep 12, 2025. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -5,8 +5,7 @@ Run following bash script:

    # Source and destination directories
    SRC_DIR="/usr/bin"
    XDG_CONFIG_HOME="$HOME/.config"
    DEST_DIR="$XDG_CONFIG_HOME/uubin"
    DEST_DIR="$HOME/.local/uubin"

    # Ensure destination directory exists
    mkdir -p "$DEST_DIR"
    @@ -32,7 +31,7 @@ echo "All uu_ files copied to $DEST_DIR with prefix stripped."
    then appending the `PATH` in your rc profile, if you are using bash, it would be `~/.bashrc` or `~/.bash_profile`:

    ```
    export PATH="$XDG_CONFIG_HOME/uubin:$PATH"
    export PATH="$HOME/.local/uubin:$PATH"
    ```

    then reload your shell
  6. runlevel5 created this gist Sep 12, 2025.
    38 changes: 38 additions & 0 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    Run following bash script:

    ```bash
    #!/bin/bash

    # Source and destination directories
    SRC_DIR="/usr/bin"
    XDG_CONFIG_HOME="$HOME/.config"
    DEST_DIR="$XDG_CONFIG_HOME/uubin"

    # Ensure destination directory exists
    mkdir -p "$DEST_DIR"

    # Find files starting with 'uu_' in /usr/bin
    find "$SRC_DIR" -type f -name 'uu_*' | while read -r src_file; do
    # Get the base filename
    filename=$(basename "$src_file")

    # Strip the 'uu_' prefix
    stripped_name="${filename#uu_}"

    # Copy to destination with new name, preserving attributes
    cp -u --preserve=mode,timestamps "$src_file" "$DEST_DIR/$stripped_name"

    # Make sure it's executable
    chmod +x "$DEST_DIR/$stripped_name"
    done

    echo "All uu_ files copied to $DEST_DIR with prefix stripped."
    ```

    then appending the `PATH` in your rc profile, if you are using bash, it would be `~/.bashrc` or `~/.bash_profile`:

    ```
    export PATH="$XDG_CONFIG_HOME/uubin:$PATH"
    ```

    then reload your shell