File: remote

package info (click to toggle)
emacspeak 49.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 28,124 kB
  • sloc: lisp: 60,077; xml: 14,159; tcl: 1,332; cpp: 1,175; sh: 859; makefile: 754; python: 534; perl: 419
file content (31 lines) | stat: -rwxr-xr-x 930 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Start a remote ssh session with reverse port forwarding
# usage: remote hostname server-script $DTK_PROGRAM  
# starts a local server, then ssh to remote-host,
# and set up reverse port forwarding.

#Examples:
# remote host.example.com  speech-server outloud 

# Configuration:

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"  
SDIR=$DIR/../servers

# Primary server listens on 2222
# Notification server listens on 3333 
function remote () {
    REMOTE=$1
    SERVER=$2
    ENGINE=$3
    $SDIR/$SERVER  2222 $SDIR/$ENGINE  &
#notification stream listens on 3333
    (export ALSA_DEFAULT="tts_mono_left" &&  $SDIR/$SERVER  3333 $SDIR/$ENGINE  &)
    play -q -n \
    synth -j 3 sin %3 sin %-2 sin %-5 sin %-9 sin %-14 sin %-21 \
    fade h .01 2 1.5 \
    delay 1.3 1 .76 .54 .27 \
    remix  - \
    fade h 0 2.7 2.5 norm -1 &
# Open SSH Connection
        ssh -R 2222:localhost:2222  -R 3333:localhost:3333 $REMOTE
}