[-] arcayne@lemmy.today 6 points 17 hours ago

CachyOS is great, much better than Bazzite or Nobara IMO. Been daily driving it on my gaming rig with an NVIDIA GPU for ~9mo. Great performamce, no complaints.

[-] arcayne@lemmy.today 3 points 1 day ago

Oooh, ouch looks really neat! May actually cause me to retire my extract function. It suddenly feels a little incomplete by comparison, lol.

# Extract any archive
extract() {
        if [ -f "$1" ]; then
                case $1 in
                *.tar.bz2) tar xjf "$1" ;;
                *.tar.gz) tar xzf "$1" ;;
                *.bz2) bunzip2 "$1" ;;
                *.rar) unrar x "$1" ;;
                *.gz) gunzip "$1" ;;
                *.tar) tar xf "$1" ;;
                *.tbz2) tar xjf "$1" ;;
                *.tgz) tar xzf "$1" ;;
                *.zip) unzip "$1" ;;
                *.Z) uncompress "$1" ;;
                *.7z) 7z x "$1" ;;
                *) echo "'$1' cannot be extracted via extract()" ;;
                esac
        else
                echo "'$1' is not a valid file"
        fi
}
[-] arcayne@lemmy.today 4 points 1 day ago

Well, my full functions.sh won't fit in a comment, so here's 2 of my more unique functions that makes life a little easier when contributing to busy OSS projects:

# Git fork sync functions
# Assumes standard convention: origin = your fork, upstream = original repo
## Sync fork with upstream before starting work
gss() {
        # Safety checks
        if ! git rev-parse --git-dir >/dev/null 2>&1; then
                echo "โŒ Not in a git repository"
                return 1
        fi

        # Check if we're in a git operation state
        local git_dir=$(git rev-parse --git-dir)
        if [[ -f "$git_dir/rebase-merge/interactive" ]] || [[ -d "$git_dir/rebase-apply" ]] || [[ -f "$git_dir/MERGE_HEAD" ]]; then
                echo "โŒ Git operation in progress. Complete or abort current rebase/merge first:"
                echo "   git rebase --continue  (after resolving conflicts)"
                echo "   git rebase --abort     (to cancel rebase)"
                echo "   git merge --abort      (to cancel merge)"
                return 1
        fi

        # Check for uncommitted changes
        if ! git diff-index --quiet HEAD -- 2>/dev/null; then
                echo "โŒ You have uncommitted changes. Commit or stash them first:"
                git status --porcelain
                echo ""
                echo "๐Ÿ’ก Quick fix: git add . && git commit -m 'WIP' or git stash"
                return 1
        fi

        # Check for required remotes
        if ! git remote get-url upstream >/dev/null 2>&1; then
                echo "โŒ No 'upstream' remote found. Add it first:"
                echo "   git remote add upstream <upstream-repo-url>"
                return 1
        fi

        if ! git remote get-url origin >/dev/null 2>&1; then
                echo "โŒ No 'origin' remote found. Add it first:"
                echo "   git remote add origin <your-fork-url>"
                return 1
        fi

        local current_branch=$(git branch --show-current)

        # Ensure we have a main branch locally
        if ! git show-ref --verify --quiet refs/heads/main; then
                echo "โŒ No local 'main' branch found. Create it first:"
                echo "   git checkout -b main upstream/main"
                return 1
        fi

        echo "๐Ÿ”„ Syncing fork with upstream..."
        echo "   Current branch: $current_branch"

        # Fetch with error handling
        if ! git fetch upstream; then
                echo "โŒ Failed to fetch from upstream. Check network connection and remote URL."
                return 1
        fi

        echo "๐Ÿ“Œ Updating local main..."
        if ! git checkout main; then
                echo "โŒ Failed to checkout main branch"
                return 1
        fi

        if ! git reset --hard upstream/main; then
                echo "โŒ Failed to reset main to upstream/main"
                return 1
        fi

        echo "โฌ†๏ธ  Pushing updated main to fork..."
        if ! git push origin main; then
                echo "โŒ Failed to push main to origin. Check push permissions."
                return 1
        fi

        echo "๐Ÿ”€ Rebasing feature branch on updated main..."
        if ! git checkout "$current_branch"; then
                echo "โŒ Failed to checkout $current_branch"
                return 1
        fi

        if ! git rebase main; then
                echo "โŒ Rebase failed due to conflicts. Resolve them and continue:"
                echo "   1. Edit conflicted files"
                echo "   2. git add <resolved-files>"
                echo "   3. git rebase --continue"
                echo "   Or: git rebase --abort to cancel"
                return 1
        fi

        echo "โœ… Ready to work on branch: $current_branch"
}

## Sync fork and push feature branch
gsp() {
        # Safety checks
        if ! git rev-parse --git-dir >/dev/null 2>&1; then
                echo "โŒ Not in a git repository"
                return 1
        fi

        local git_dir=$(git rev-parse --git-dir)
        if [[ -f "$git_dir/rebase-merge/interactive" ]] || [[ -d "$git_dir/rebase-apply" ]] || [[ -f "$git_dir/MERGE_HEAD" ]]; then
                echo "โŒ Git operation in progress. Complete or abort first."
                return 1
        fi

        if ! git diff-index --quiet HEAD -- 2>/dev/null; then
                echo "โŒ You have uncommitted changes. Commit or stash them first:"
                git status --porcelain
                return 1
        fi

        if ! git remote get-url upstream >/dev/null 2>&1; then
                echo "โŒ No 'upstream' remote found"
                return 1
        fi

        if ! git remote get-url origin >/dev/null 2>&1; then
                echo "โŒ No 'origin' remote found"
                return 1
        fi

        local current_branch=$(git branch --show-current)

        # Prevent pushing from main
        if [[ "$current_branch" == "main" ]]; then
                echo "โŒ Cannot push from main branch. Switch to your feature branch first:"
                echo "   git checkout <your-feature-branch>"
                return 1
        fi

        # Show what we're about to do
        echo "โš ๏ธ  About to sync and push branch: $current_branch"
        echo "   This will:"
        echo "   โ€ข Fetch latest changes from upstream"
        echo "   โ€ข Rebase your branch on updated main"
        echo "   โ€ข Force-push to your fork (updates PR)"
        echo ""

        read -p "Continue? [y/N]: " -n 1 -r
        echo

        if [[ ! $REPLY =~ ^[Yy]$ ]]; then
                echo "โŒ Operation cancelled"
                return 0
        fi

        echo "๐Ÿ”„ Final sync with upstream..."
        if ! git fetch upstream; then
                echo "โŒ Failed to fetch from upstream"
                return 1
        fi

        echo "๐Ÿ“Œ Updating local main..."
        if ! git checkout main; then
                echo "โŒ Failed to checkout main"
                return 1
        fi

        if ! git reset --hard upstream/main; then
                echo "โŒ Failed to reset main"
                return 1
        fi

        if ! git push origin main; then
                echo "โŒ Failed to push main to origin"
                return 1
        fi

        echo "๐Ÿ”€ Rebasing feature branch..."
        if ! git checkout "$current_branch"; then
                echo "โŒ Failed to checkout $current_branch"
                return 1
        fi

        if ! git rebase main; then
                echo "โŒ Rebase failed. Resolve conflicts and try again:"
                echo "   git add <resolved-files> && git rebase --continue"
                echo "   Then run 'gsp' again"
                return 1
        fi

        echo "๐Ÿš€ Pushing feature branch to fork..."
        if ! git push origin "$current_branch" --force-with-lease; then
                echo "โŒ Failed to push to origin. The branch may have been updated."
                echo "   Run 'git pull origin $current_branch' and try again"
                return 1
        fi

        echo "โœ… Feature branch $current_branch successfully pushed to fork"
}
[-] arcayne@lemmy.today 2 points 1 week ago

Wow - you've certainly got a unique perspective on the situation, and I'm grateful that you took the time to share it. Thank you. It's fascinating to hear from someone who actually worked with the guy.

I can relate to both the Linux struggle and your "I get their PoV but disagree" reaction. Had the same feeling when Kitty's creator dismissed multiplexers as "a hack" - as a longtime tmux user, that stung. Great tool, but that philosophy never sat right with me. I bounced between most of the more popular terminals for years (Wezterm rocks but has performance issues, Kitty never felt quite right) so I was eager for Ghostty to drop. So far it's delivered on what I was hoping for (despite needing a minor tweak or two out of the box).

I'm glad you found my last response so helpful. Sounds like exploring alternatives worked out well for you in the end, which is what matters. Cheers. :)

[-] arcayne@lemmy.today 3 points 1 week ago

That's fair, I get the frustration.

I guess I've been cutting Mitchell some slack since this is a passion project for him - his goal was to build the modern terminal he always wanted, so an opinionated feature set was always expected. And, new terminals with actual new features need their own terminfo entries, it just comes with the territory. It'll sort itself out as the databases catch up.

For now, though, you don't need to address this on an individual host level. I'm in the same boat at work with thousands of servers. If you want to give Ghostty another shot, this wrapper handles the issue automatically, even for servers where AcceptEnv doesn't include TERM or where SetEnv is disabled:

ssh() {
    if [[ "$TERM" == "xterm-ghostty" ]]; then
        TERM=xterm-256color command ssh "$@"
    else
        command ssh "$@"
    fi
}

Just drop it in your .bashrc (or functions.sh if you rock a modular setup) and SSH connections will auto-switch to compatible terminfo while keeping your local session full-featured. Best of both worlds. ยฏ\_(ใƒ„)_/ยฏ

[-] arcayne@lemmy.today 2 points 1 week ago

Just gotta adjust your TERM value. You can do it per host in your ssh config, if you don't wanna set it globally. SetEnv TERM=xterm-256color

[-] arcayne@lemmy.today 7 points 3 weeks ago

I'd recommend using OpenTofu (Terraform) for initial provisioning of VMs and then use Ansible for post-provisioning config & management. That way you're letting both tools play to their strengths.

https://registry.terraform.io/providers/bpg/proxmox/latest/docs

[-] arcayne@lemmy.today 1 points 1 month ago

Did you mean Netbox?

arcayne

joined 1 year ago