File: remote

package info (click to toggle)
emacspeak 53.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,768 kB
  • sloc: lisp: 56,393; xml: 52,463; tcl: 1,333; cpp: 1,168; sh: 859; makefile: 739; python: 547; perl: 509; javascript: 191; ansic: 82
file content (48 lines) | stat: -rwxr-xr-x 1,521 bytes parent folder | download | duplicates (3)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 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.
# See https://hackertarget.com/ssh-examples-tunnels/ for ssh tunnel tips
#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
}

#setup tts, but dont ssh.
#use when we need  to restart server
# hard-wire speech-server and outloud $remote not used 
function rtts () {
    SERVER=speech-server
    ENGINE=outloud 
    $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 &
}