4 ms·
2 weeks ago someone asked > Ask HN: Can I see your scripts?[1] I really like this[2] solution from /u/hoechst, > Not really a script, but a `.ssh/config` to
by rovr138 4y ago
2 weeks ago someone asked
> Ask HN: Can I see your scripts?[1]
I really like this[2] solution from /u/hoechst,
> Not really a script, but a `.ssh/config` to automatically deploy parts of my local cli environment to every server i connect to (if username and ip/hostname matches my rules).
> On first connect to a server, this sync all the dotfiles i want to a remote host and on subsequent connects, it updates the dotfiles.
> Idk if this is "special", but I haven't seen anyone else do this really and it beats for example ansible playbooks by being dead simple.
Match Host 192.168.123.*,another-example.org,*.example.com User myusername,myotherusername
ForwardAgent yes
PermitLocalCommand yes
LocalCommand rsync -L --exclude .netrwhist --exclude .git --exclude .config/iterm2/AppSupport/ --exclude .vim/bundle/youcompleteme/ -vRrlptze "ssh -o PermitLocalCommand=no" %d/./.screenrc %d/./.gitignore %d/./.bash_profile %d/./.ssh/git_ed25519.pub %d/./.ssh/authorized_keys %d/./.vimrc %d/./.zshrc %d/./.config/iterm2/ %d/./.vim/ %d/./bin/ %d/./.bash/ %r@%n:/home/%r
[1] https://news.ycombinator.com/item?id=32467957 https://news.ycombinator.com/item?id=32467957
[2] https://news.ycombinator.com/item?id=32468605 https://news.ycombinator.com/item?id=32468605
- folkrav 4y agoI could see both being really useful. I don't want my full dotfiles available on arbitrary remote servers. But being able to setup a new dev environment by just cloning my dotfiles and linking them back is also invaluable.
- rovr138 4y agoExactly. I don't think that deploying all my dotfiles to a remote server is smart. But there are a few things that could be deployed that would help with quality of life. I think this is a great way of doing that.