-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·75 lines (61 loc) · 1001 Bytes
/
run.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
#!/bin/bash
#
# Misc scripts.
#
# Usage:
# ./run.sh <function name>
set -o nounset
log() {
echo 1>&2 "$@"
}
unit() {
local this_dir=$(dirname $0)
export PYTHONPATH=$this_dir:~/hg/tnet/python:~/hg/json-template/python
"$@"
}
usage-sink() {
# listen in UDP mode on port 8988
log 'usage sink'
nc -v -u -l localhost 8988
}
usage-send() {
echo foo | nc -u localhost 8988
}
usage-config() {
local addr='localhost:19999'
echo $addr > webpipe/usage-address.txt
echo $addr > latch/usage-address.txt
}
#
# Gen testdata
#
make-plot-png() {
local path=plugins/png/testdata/tiny.png
R --vanilla --slave <<EOF
print('hi')
png('$path')
plot(1:3)
dev.off()
EOF
ls -l $path
}
#
# Latch
#
# for doc.sh, use Makefile perhaps?
latch-demo() {
./latch.sh rebuild './doc.sh main' README.md doc/*.md
}
#
# Aliases
#
make-alias() {
pushd plugins
# assume terminal is ansi
ln -s -v ansi typescript
ln -s -v jpeg jpg
ln -s -v html htm
ln -s -v markdown md
popd
}
"$@"