Live data from Hacker News

Show HN: Shittp – Volatile Dotfiles over SSH

github.com

81–90 of 97 posts

Re: Show HN: Shittp – Volatile Dotfiles over SSH

#81

Earlier quoted context omitted.

I can’t recall encountering a system in the last 15 years that didn’t have vim (or at least vi for esoteric things) on it.

Would not be uncommon in a container or purpose-built VM.

Have you run into that? I can't recall ever facing that issue. Seems very weird to strip down that much and then use a different editor. Do you remember if ed was missing in those machines?

Re: Show HN: Shittp – Volatile Dotfiles over SSH

#82

Earlier quoted context omitted.

scp my-precious-dotfiles remote:~ trap 'ssh remote rm my-precious-dotfiles' EXIT ssh remote Or you can even bake the trap into the remote bash's invocation, although that'd be a bit harder.

That overwrites the remote dotfiles. Any workarounds?

:h netrw

You can also just place config files anywhere if you know what you then load. That's what I do in my dotfiles, but not exactly like the parent. I also purposefully keep the repo size tiny so it's also just easy to clone. I'd recommend setting a env var so you can always just set that

Also don't forget you can have local vim files. I have a function at the end of my vimrc that looks for '.exrc', '.vim.local', '.nvim.local' in the current directory. Helpful for setting project settings.

Re: Show HN: Shittp – Volatile Dotfiles over SSH

#83
post #20

I wonder why are dofiles have to be on remote machines? e.g. I type an alias, the ssh client expands it on my local machine and send complex commands to remote. Could this be possible? I suppose a special shell could make it work.

> I wonder why are dofiles have to be on remote machines? Because the processes that use them run on the remote machines. > I type an alias, the ssh client expands it on my local machine and send complex commands to remote. This is not how SSH works. It merely takes your keystrokes and sends them to the remote machine, where bash/whatever reads and processes them. Of course, you can have it work the way you imagine,…

> the processes that use them run on the remote

Yes but but does the process have to read from a file system dotfile, instead of some data fetched over a ssh connection?

> your alias includes a process substitution

Very valid point. How about a special shell only provides sys calls and process substitution on remote, the rest runs on local client, and communicate via ssh?

I understand this will make client "fat" but it's way more portable.

Re: Show HN: Shittp – Volatile Dotfiles over SSH

#85
post #70
post #62

Earlier quoted context omitted.

Well, what if it's a separate directory meant exclusively for remote systems alone? And what if the remote mount is read-only, perhaps with a writable layer on top using overlayfs that can be discarded on logout?

This now looks very complex.

It's actually far less complex than what container runtimes do. I've even done parts of those, which is why I'm able to suggest it. I'm thinking about implementing it and was checking if anybody else wanted to do it or if they foresee any problems that I can't.

Re: Show HN: Shittp – Volatile Dotfiles over SSH

#86

Earlier quoted context omitted.

scp my-precious-dotfiles remote:~ trap 'ssh remote rm my-precious-dotfiles' EXIT ssh remote Or you can even bake the trap into the remote bash's invocation, although that'd be a bit harder.

That overwrites the remote dotfiles. Any workarounds?

You can set HOME to some temporary path of your choosing. You’ll still need to be a little careful.

Re: Show HN: Shittp – Volatile Dotfiles over SSH

#87

Earlier quoted context omitted.

Any sufficiently-advanced automated rsync would have a filter for caches.

Except only ssh is filtered. Just commenting on what I see, not what should be

What I mean is an .rsync-filter with ‘H Cache/‘ or some lines of patterns to exclude. You’ll need to run with -F every time. On the sending side, a recent tar will accept —-exclude-caches if you can be diligent about creating CACHEDIR.TAG.

Re: Show HN: Shittp – Volatile Dotfiles over SSH

#89
post #83

Earlier quoted context omitted.

> I wonder why are dofiles have to be on remote machines? Because the processes that use them run on the remote machines. > I type an alias, the ssh client expands it on my local machine and send complex commands to remote. This is not how SSH works. It merely takes your keystrokes and sends them to the remote machine, where bash/whatever reads and processes them. Of course, you can have it work the way you imagine,…

> the processes that use them run on the remote Yes but but does the process have to read from a file system dotfile, instead of some data fetched over a ssh connection? > your alias includes a process substitution Very valid point. How about a special shell only provides sys calls and process substitution on remote, the rest runs on local client, and communicate via ssh? I understand this will make client "fat" but…

> Yes but but does the process have to read from a file system dotfile, instead of some data fetched over a ssh connection?

Well, no. But if you didn't write that program (e.g. bash or vim), you're stuck with what their actual logic is. Which is "read a file from the filesystem". You can, of course, do something like mounting your local home directory onto the remote's filesystem (hopefully, read-only)... But in the end of the day, there are still two separate machines, and you have to mend the divide somehow, and it'll never be completely pretty, I'm afraid.

> How about a special shell only provides sys calls and process substitution on remote.

Again, as I said, lots of RATs exist, not all of them malicious. But to make "the rest runs on local client" you need to write what essentially will end up a "purely remote-only shell". Essentially, all the parts of bash that manage parsing, user interaction and internal state tracking but without actual process management. Perhaps it's a good idea, actually; but untangling the mess of bash source is not going to be easy.

The current solution of "have a completely normal, standard shell run on the remote and stretch the terminal connection to it over the network" is Good Enough for most of people. Which is not surprising given that that's the environment in which UNIX and its shell were originally implemented.

Re: Show HN: Shittp – Volatile Dotfiles over SSH

#90
post #76

Earlier quoted context omitted.

That overwrites the remote dotfiles. Any workarounds?

GNU Stow? https://systemcrafters.net/managing-your-dotfiles/using-gnu-... Keep the alternate sets in different subdirectories.

It's kinda amusing how much of interesting software there is beyond coreutils and GCC that came from GNU, and how little adoption it has actually seen.
Post reply on HN