It can’t hurt to share some of you current helpers. Either someone else might get inspired by or in some cases you get suggestions how to make it better. Bash, Zsh, Fish or whatever shell script, command or alias (or abbreviation) you have, share here. Always fun to do so! I share mine in the comments, just like everybody else.

  • eldavi@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    39 minutes ago

    i use these 2 several times a day to back and forth between my work and personal laptop/workstation. (i can’t get the formatting right here on lemmy):

    start_inputleap_tunnel() {
        mkdir -p ~/.inputleap
     
        AUTOSSH_GATETIME=0 nohup autossh -M 0 -N -R 24800:127.0.0.1:24800 \
        -o TCPKeepAlive=yes \
        -o ServerAliveInterval=15 \
        -o ServerAliveCountMax=3 \
        -o ExitOnForwardFailure=yes \
        -o Compression=no \
        -o IPQoS=throughput \
        [email protected] > ~/.inputleap/autossh.log 2>&1 &
        disown
     
        nohup sh -c 'while true; do pkill -x input-leaps; /Applications/InputLeap.app/Contents/MacOS/input-leaps -f --config ~/.inputleap/synergy.conf --debug INFO --disable-crypto --name TS-eas-davcasta --address 127.0.0.1 >> ~/.inputleap/inputleaps.log 2>&1; sleep 2; done' >/dev/null 2>&1 &
        disown
    }
     
    start_inputleap_tunnel_reverse() {
        mkdir -p ~/.inputleap
     
        # 1. Start AutoSSH (AUTOSSH_GATETIME=0 prevents backoff delays on quick restarts)
        AUTOSSH_GATETIME=0 nohup autossh -M 0 -N -R 24800:127.0.0.1:24800 \
        -o TCPKeepAlive=yes \
        -o ServerAliveInterval=15 \
        -o ServerAliveCountMax=3 \
        -o ExitOnForwardFailure=yes \
        -o Compression=no \
        -o IPQoS=throughput \
        [email protected] > ~/.inputleap/autossh.log 2>&1 &
        disown
     
        # 2. Start InputLeap server loop
        nohup sh -c 'while true; do pkill -x input-leaps; /Applications/InputLeap.app/Contents/MacOS/input-leaps -f --config ~/.inputleap/reverse-synergy.conf --debug INFO --disable-crypto --name TS-eas-davcasta --address 127.0.0.1 >> ~/.inputleap/inputleaps.log 2>&1; sleep 2; done' >/dev/null 2>&1 &
        disown
    }
    
    alias startleap=start_inputleap_tunnel
    alias startleapreverse=start_inputleap_tunnel_reverse
    
    • thingsiplay@lemmy.mlOP
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      2 hours ago

      Interesting. I can’t comment much about the commands itself, but want to quickly explain how to format. To start a code block, put 3 ticks in row like ``` in one line. Everything after is a code block until 3 ticks end it. You can also set what type of (programming) language it is, for the coloring. Just add bash after the 3 ticks in the opening block like ```bash . That’s all to it. I don’t know hat languages are supported, but it works for Bash and Python in example. A full code block would be typed like this:

      ```bash
      hello() {
          echo "Hello World!"
      }
      ```
      

      which is then rendered as

      hello() {
          echo "Hello World!"
      }
      
      • eldavi@lemmy.ml
        link
        fedilink
        English
        arrow-up
        2
        ·
        38 minutes ago

        the ticks work and now you can see my badly formatted bash in all of it’s ugly glory. lol

        thanks.