-
-
Notifications
You must be signed in to change notification settings - Fork 454
/
test.sh
executable file
·173 lines (125 loc) · 2.74 KB
/
test.sh
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#!/bin/bash
function killgop {
echo "killing $1"
if [[ "$OSTYPE" == "linux-gnu" ]]; then
kill -9 $1
elif [[ "$OSTYPE" == "darwin"* ]]; then
kill -TERM $1
fi
}
echo "beginner"
echo "HelloWorld"
go run ./beginner/HelloWorld.go
echo "var"
go run ./beginner/var.go
echo "if"
go run ./beginner/if.go Hello
echo "array"
go run ./beginner/array.go
echo "function"
go run ./beginner/function.go
echo "for"
go run ./beginner/for.go
echo "foreach"
go run ./beginner/foreach.go
echo "args"
go run ./beginner/args.go string string2
echo "input"
go run ./beginner/input.go
echo "flag"
go run ./beginner/flag.go
echo "dir"
go run ./beginner/dir.go
echo "time"
go run ./beginner/time.go
echo "random"
go run ./beginner/random.go
echo "cat"
go run ./beginner/cat.go
echo "modulo"
go run ./beginner/modulo.go
echo "split"
go run ./beginner/split.go
echo "hashing"
go run ./beginner/hashing.go
echo "ackermann"
go run ./beginner/ackermann.go
echo "euklid"
go run ./beginner/euklid.go
echo "variadic function"
go run ./beginner/functionvariadic.go
echo "delete fom slice"
go run ./beginner/deleteFromSlice.go
echo "advanced"
echo "pythagoras"
go run ./advanced/pythagoras.go 10 15 ?
echo "wait"
go run ./advanced/wait.go
echo "lifo"
go run ./advanced/lifo.go
echo "regex"
go run ./advanced/regex.go
echo "fibonacci"
go run ./advanced/fibonacci.go
echo "prime"
go run ./advanced/prime.go 32
echo "numbers"
go run ./advanced/numbers.go
echo "json"
go run ./advanced/json.go
echo "exec"
go run ./advanced/exec.go
echo "suicide"
go run ./advanced/suicide.go
echo "in array search"
go run ./advanced/in_array.go
echo "benchmarking json marshal and unmarshal"
go test -bench=. -benchmem ./advanced/json_bench/main_test.go
echo "expert"
echo "color"
go run ./expert/color.go
echo "telnet"
go run ./expert/telnet.go &
sleep 10
nc localhost 2223 < lorem
killgop $!
echo "httpd"
go run ./expert/httpd.go &
sleep 10
for i in {1..10}; do curl http://localhost:8080; done;
killgop $!
echo "httpsd"
cd expert
go run ./httpsd.go &
sleep 5
echo "waiting 10 seconds - then make 10 connections"
sleep 10
for i in {1..10}; do curl https://localhost:4443 --insecure; done;
killgop $!
cd ..
echo "cookies"
go run ./expert/cookies.go &
sleep 10
for i in {1..2}; do curl http://localhost:8080; done;
killgop $!
echo "proxy"
go run ./expert/proxy.go &
sleep 10
curl https://localhost:8080 --insecure
killgop $!
echo "ppk-crypto"
go run ./export/ppk-crypto.go
echo "image"
cd expert
go run ./image.go
echo "sqlite"
go get github.com/mxk/go-sqlite/sqlite3
go run ./sqlite.go insert test
go run ./sqlite.go select
cd ..
echo "parallel"
export GOMAXPROCS=8
time go run ./expert/parallel.go true
time go run ./expert/parallel.go false
echo "dynparallel"
time go run ./expert/dynparallel.go 8