I’m playing with a couple of routers and comparing proprietary to open source on the same hardware. I miss my .bashrc functions and aliases… and compgen, tree, manpages, detailed help, etc; the little things that get annoying when they are missing.

I was thinking about trying to mount the embedded system on my workstation (while it is running?), but I’m not clear how this would work in practice with permissions, users, groups, root, etc. I’m curious how others do this kind of development/screwing around, or if this is a crazy idea.

  • bus_factor@lemmy.world
    link
    fedilink
    arrow-up
    18
    ·
    11 个月前

    If you have ssh/SCP you can use sshfs to mount the remote host as a fuse filesystem. That would let you edit files on your workstation, but more or less all other commands would still need to happen on the remote system.

  • misophist@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    11 个月前

    I edit everything in my local copy of the repository and then push the changes to my devices with ansible.

    • thejml@lemm.ee
      link
      fedilink
      English
      arrow-up
      1
      ·
      11 个月前

      Same, but I’ve got Ansible (or Puppet) powered off of a git repo. So I make my changes, commit/push to fit and then Ansible takes it from there.

  • Ramin Honary@lemmy.ml
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    11 个月前

    This is probably not a solution you would want, but I will mention it anyway…

    Emacs has a built-in app called “TRAMP mode”, what it does is it works as back-end for all of Emacs’s own built-in text editing and file browsing commands, then it uses ordinary SSH and POSIX shell commands on a remote host as the primitive APIs for this back-end. You could say it uses SSH and a POSIX shell as a RPC mechanism.

    What this means is you can use the ordinary Emacs editor with the entirety of your usual Emacs configuration, but all filesystem changes (including editing files, directories, and running shell processes) occur on the remote host via SSH. In order to activate it, you just use Emacs’s special TRAMP URL scheme as the file path you want to edit, and it works seamlessly, (especially if you setup your SSH agent so you don’t need a password). An example of such a URL would be /ssh:user@remote-host:/etc/hosts.

  • lemmyvore@feddit.nl
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    11 个月前

    There isn’t usually much to do on an embedded router other than use its own commands to change settings or manage packages. And if it has enough juice to run more advanced stuff it probably has bash available too.

    Anyway, there’s NFS for mounting filesystems remotely. It’s not very complicated, the catch is that the same UIDs and GUIDs on the host must exist on the guest, because it doesn’t do any uid translation. On an embedded system most stuff is owned by root, meaning you’d have to use root on guest too, which may not be a great idea.

    Secondly, you can’t run commands over NFS, just manipulate files and I’m not sure that’s something you really need to do a lot of on a router.

  • trevor
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    11 个月前

    People with PhDs in Vim will laugh at this, but I sometimes connect to remote systems through VS Code SSH connections when I’m working on a project with multiple files on a remote system.

    • kunaltyagi@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      11 个月前

      I’ve used mirror.vim for this. Pretty much similar UX as remote workspaces. Forone off editing, you can do vim ssh://remote/

      Sometimes, VS Code-ium is piss poor especially over bad connections but otherwise the remote management is quite awesome

      And ofc, there’s emacs with TRAMP mode

  • pixelscript@lemmy.ml
    link
    fedilink
    English
    arrow-up
    4
    ·
    11 个月前

    I am not quite yet st the level where I have a ton of user scripts I’d be lost without, so SSHing into a box is hardly a speed bump for me.

  • RedKrieg@lemmy.redkrieg.com
    link
    fedilink
    English
    arrow-up
    3
    ·
    11 个月前

    I don’t recommend using the shell on routers for day-to-day management. Instead, consider using a network configuration management system like rconfig. I’ve used RANCID in the past, but I suspect something more modern like rconfig will be useful to you.

  • toastal@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    11 个月前

    You can use something like Nix + home-manager & take your environment with you.