Remix.run Logo
sdovan1 14 hours ago

I often need to login to colleagues' machines at work, but I find that their settings are not what I am familiar with. So I wrote an SSH wrapper in POSIX shell which tars dotfiles into a base64 string, passes it to SSH, and decodes / setups on the remote temp directory. Automatically remove when session ends.

Supported: .profile, .vimrc, .bashrc, .tmux.conf, etc.

This idea comes from kyrat[1]; passing files via a base64 string is a really cool approach.

[1]: https://github.com/fsquillace/kyrat/

Joker_vD 12 hours ago | parent | next [-]

   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.
stephenlf 5 hours ago | parent [-]

That overwrites the remote dotfiles. Any workarounds?

zeech 20 minutes ago | parent | next [-]

I've found lnk [0] to be a nice tool for this. Similar to GNU Stow as another comment mentioned, but plays a bit nicer with git (and, in my opinion, is nicer to use).

Edit: just remembered there was a good comparison of lnk and stow on the HN discussion of lnk from a few months back [1].

[0] https://github.com/yarlson/lnk

[1] https://news.ycombinator.com/item?id=44080514

rzzzt 2 hours ago | parent | prev [-]

GNU Stow? https://systemcrafters.net/managing-your-dotfiles/using-gnu-...

Keep the alternate sets in different subdirectories.

alsetmusic 11 hours ago | parent | prev | next [-]

I came across something similar a few months ago. I pieced together a working hybrid by patching in parts from an older release with the latest version. I didn't ever work out if the latest version failed because of something in my environment or not, but I'm on a Mac fwiw.

https://github.com/cdown/sshrc

xuhu 4 hours ago | parent | prev | next [-]

How much time does it add when running e.g. "shittp user@lan-host uname" ?

11 hours ago | parent | prev | next [-]
[deleted]
amelius 12 hours ago | parent | prev [-]

Ok, but what if your colleague does not have Vim installed?

Wouldn't it make more sense to have a tool that brings files over to the local computer, starts Vim on them, and then copies them back?

Joker_vD 12 hours ago | parent | next [-]

That starts to sound like using VS Code in remote mode.

exe34 12 hours ago | parent [-]

Emacs in tramp mode.

QuinnyPig 12 hours ago | parent | prev | next [-]

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.

SoftTalker 4 hours ago | parent | next [-]

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

11 hours ago | parent | prev [-]
[deleted]
sdovan1 11 hours ago | parent | prev [-]

We usually work on the VM with daily-built ISO. For example, I would compile and upload Java program to the frontend team member's VM, and type "srt" for "systemctl restart tomcat."