Repository navigation
Expand file tree
/
Copy pathremote
More file actions
122 lines (104 loc) · 2.49 KB
/
Copy pathremote
File metadata and controls
122 lines (104 loc) · 2.49 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/usr/bin/env zsh
#
# remote control
#
runname=`basename $0`
ngrok_set_linux () {
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok
}
ngrok_token () {
ngrok authtoken $1
}
case $runname in
fatavay)
fat1ip="192.168.10.10"
fat2ip="192.168.10.20"
fat3ip="192.168.10.30"
fat4ip="192.168.10.40"
fat5ip="192.168.10.50"
fat1="f1@$fat1ip"
fat2="f1@$fat2ip"
fat3="f1@$fat3ip"
fat4="f1@$fat4ip"
fat5="f1@$fat5ip"
safer="safer@$fat5ip"
port=22
;;
ngrok)
ngfatip="0.tcp.ngrok.io"
port=17777
ngrok_ini () {
nohup ngrok tcp 22 --log=stdout > "$HOME/.ngrok2/ngrok.log" --region ap &
}
ngfat () {
user=$1
port=$2
ssh -X -Y ${user}@${ngfatip} -p${port}
}
alias ngdcm='ngfat dcm $port'
;;
shu)
shuip="175.155.64.34"
shu="f1@$shuip"
port=22
;;
esac
cpfat () {
case $1 in
"1")
fat=$fat1
;;
"2")
fat=$fat2
;;
"3")
fat=$fat3
;;
"4")
fat=$fat4
;;
"5")
fat=$fat5
;;
"s")
fat=$safer
;;
ng)
fat=dcm@0.tcp.ap.ngrok.io
;;
shu)
fat=$shu
;;
esac
scp -P $port $2 $fat:~/.
}
mofat () {
if [[ $1 == 1 ]]; then fat=$fat1; fi
if [[ $1 == 2 ]]; then fat=$fat2; fi
if [[ $1 == 3 ]]; then fat=$fat3; fi
if [[ $1 == 4 ]]; then fat=$fat4; fi
if [[ $1 == 5 ]]; then fat=$fat5; fi
if [[ $1 == 's' ]]; then fat=$safer; fi
if [[ $1 == 'shu' ]]; then fat=$shu; fi
cpfat $1 ~/.zshrc
mosh $fat
}
shfat () {
if [[ $1 == 1 ]]; then fat=$fat1; fi
if [[ $1 == 2 ]]; then fat=$fat2; fi
if [[ $1 == 3 ]]; then fat=$fat3; fi
if [[ $1 == 4 ]]; then fat=$fat4; fi
if [[ $1 == 5 ]]; then fat=$fat5; fi
if [[ $1 == 's' ]]; then fat=$safer; fi
if [[ $1 == 'shu' ]]; then fat=$shu; fi
cpfat $1 ~/.zshrc
ssh -X -Y $fat
}
shufat () {
ssh -X -Y h14@175.155.64.34
}
upfat () {
tar zcvf xxx.tgz $1
cpfat $2 ./xxx.tgz
rm xxx.tgz
}