simple web page and svg generated using cgi and gnuplot
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 5 Oct 2020 16:47:12 +0000 (18:47 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 5 Oct 2020 16:55:42 +0000 (18:55 +0200)
www/cgi-bin/svg.cgi [new file with mode: 0755]
www/index.html [new file with mode: 0644]

diff --git a/www/cgi-bin/svg.cgi b/www/cgi-bin/svg.cgi
new file mode 100755 (executable)
index 0000000..128e915
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+dir=/home/dpavlin/zc/gnuplot/
+
+echo "Content-type: image/svg+xml"
+echo
+
+psql --username=dpavlin -A -F "," -t zc < $dir/axes.sql > /dev/shm/axes.txt.$$
+cat $dir/axes.gnuplot | sed -e "s,axes.txt,/dev/shm/axes.txt.$$," -e "s,^set terminal.*$,set terminal svg," -e "s,^set output.*$,set output," > /dev/shm/axes.gnuplot.$$
+gnuplot /dev/shm/axes.gnuplot.$$
+
+rm /dev/shm/axes.txt.$$ /dev/shm/axes.gnuplot.$$
diff --git a/www/index.html b/www/index.html
new file mode 100644 (file)
index 0000000..7506060
--- /dev/null
@@ -0,0 +1,9 @@
+<html>
+<head>
+       <title>Subvision senzori</title>
+</head>
+<body>
+
+       <h1>sensor axes</h1>
+       <img src="cgi-bin/svg.cgi">
+</body>