40
submitted 2 days ago by thingsiplay@lemmy.ml to c/linux@lemmy.ml

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.

you are viewing a single comment's thread
view the rest of the comments
[-] eldavi@lemmy.ml 4 points 1 day ago* (last edited 1 day 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 \
    moi@azulita.local > ~/.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 \
    moi@azulita.local > ~/.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
[-] pjusk@lemmy.dbzer0.com 4 points 1 day ago

Woukd you mind elaborating on these functions?

[-] eldavi@lemmy.ml 2 points 23 hours ago

they wrap autossh and input-leap around nohup for both and a while loop for the latter so that it'll auto restart if it crashes -- i don't know what else doesn't instantly explain itself, but wouldn't mind clarifying further if needed.

[-] thingsiplay@lemmy.ml 4 points 1 day ago* (last edited 1 day 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 3 points 1 day ago

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

thanks.

this post was submitted on 02 Dec 2026
40 points (97.6% liked)

Linux

69006 readers
446 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS