From 48a1b124ddb94075b802169929af531ec99e9c49 Mon Sep 17 00:00:00 2001 From: Pyroseza Date: Thu, 22 Oct 2020 23:12:47 +0100 Subject: [PATCH 01/20] added the paradoc golfing language as seen on Advent of Code --- lxc/executors/paradoc | 2 ++ lxc/versions | 4 ++++ readme.md | 9 +++++++++ 3 files changed, 15 insertions(+) create mode 100755 lxc/executors/paradoc diff --git a/lxc/executors/paradoc b/lxc/executors/paradoc new file mode 100755 index 0000000..4a7e9c5 --- /dev/null +++ b/lxc/executors/paradoc @@ -0,0 +1,2 @@ +cd /tmp/$2 +runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 python3 -m paradoc code.code" diff --git a/lxc/versions b/lxc/versions index 830e69c..c3b03fa 100755 --- a/lxc/versions +++ b/lxc/versions @@ -85,6 +85,10 @@ echo 'python3' lxc-attach --clear-env -n piston -- /bin/bash -l -c "python3 -V" echo '---' +echo 'paradoc' +lxc-attach --clear-env -n piston -- /bin/bash -l -c "python3 -m paradoc --version" +echo '---' + echo 'ruby' lxc-attach --clear-env -n piston -- /bin/bash -l -c "ruby --version" echo '---' diff --git a/readme.md b/readme.md index 2f6c119..d694e24 100644 --- a/readme.md +++ b/readme.md @@ -85,6 +85,14 @@ ln -s python python3.8 echo 'export PATH=$PATH:/opt/python3/Python-3.8.2' >> /opt/.profile source /opt/.profile +# install paradoc +# this is not a binary, it is a python module +# therefore it cannot be run directly as it requires python3 to be installed +cd /opt && mkdir paradoc && cd paradoc +git clone https://github.com/betaveros/paradoc.git +echo 'export PYTHONPATH=$PYTHONPATH:/opt/paradoc/paradoc' >> /opt/.profile +source /opt/.profile + # install node.js # final binary: /opt/nodejs/node-v12.16.1-linux-x64/bin/node # get version: /opt/nodejs/node-v12.16.1-linux-x64/bin/node -v @@ -357,6 +365,7 @@ If an invalid language is supplied, a typical response will look like the follow - php - python2 - python3 +- paradoc - ruby - rust - swift From 3ea5f13d4c157019bec13c140a04e9c5f95edbbf Mon Sep 17 00:00:00 2001 From: Pyroseza Date: Thu, 22 Oct 2020 23:19:05 +0100 Subject: [PATCH 02/20] added paradoc to the go api --- api/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/api/main.go b/api/main.go index 446f3e4..193eba9 100644 --- a/api/main.go +++ b/api/main.go @@ -88,6 +88,7 @@ func Execute(res http.ResponseWriter, req *http.Request) { "php", "python2", "python3", "python", + "paradoc", "ruby", "rust", "swift", From 9f9af342fd4171377164b1445ae3c69e31a0bc39 Mon Sep 17 00:00:00 2001 From: Pyroseza Date: Thu, 22 Oct 2020 23:25:57 +0100 Subject: [PATCH 03/20] added paradoc test --- lxc/test_all_lxc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lxc/test_all_lxc b/lxc/test_all_lxc index f2068bd..c7f0b28 100755 --- a/lxc/test_all_lxc +++ b/lxc/test_all_lxc @@ -49,3 +49,5 @@ echo 'testing python2' ../execute python2 test2.py echo 'testing python3' ../execute python3 test3.py +echo 'testing paradoc' +../execute python3 test_paradoc.py From 47601eda51ed64b7e4415baf787def104b233b13 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Sun, 25 Oct 2020 12:40:53 -0500 Subject: [PATCH 04/20] manually add brainfuck version to piston --- lxc/versions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lxc/versions b/lxc/versions index 830e69c..c53e779 100755 --- a/lxc/versions +++ b/lxc/versions @@ -9,6 +9,10 @@ echo 'bash' lxc-attach --clear-env -n piston -- /bin/bash -l -c "bash --version" echo '---' +echo 'brainfuck' +echo '1.0.0' +echo '---' + echo 'c' lxc-attach --clear-env -n piston -- /bin/bash -l -c "gcc -v" echo '---' From 88fad36496609297a44dbfe98478bc652c9acdf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Barbi=C4=87?= Date: Thu, 29 Oct 2020 22:39:14 +0100 Subject: [PATCH 05/20] Update Kotlin Update Kotlin to 1.4.10 --- readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 2f6c119..94e3b44 100644 --- a/readme.md +++ b/readme.md @@ -179,9 +179,9 @@ source /opt/.profile # final binary: /opt/kotlinc/bin/kotlinc # get version: /opt/kotlinc/bin/kotlinc -version cd /opt -wget https://github.com/JetBrains/kotlin/releases/download/v1.3.72/kotlin-compiler-1.3.72.zip -unzip kotlin-compiler-1.3.72.zip -rm kotlin-compiler-1.3.72.zip +wget https://github.com/JetBrains/kotlin/releases/download/v1.4.10/kotlin-compiler-1.4.10.zip +unzip kotlin-compiler-1.4.10.zip +rm kotlin-compiler-1.4.10.zip echo 'export PATH=$PATH:/opt/kotlinc/bin' >> /opt/.profile source /opt/.profile From d72512be18c4dec213b6c5a2bc75efbfdfb27d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Barbi=C4=87?= Date: Fri, 30 Oct 2020 21:28:51 +0100 Subject: [PATCH 06/20] Allow use of interface --- lxc/executors/java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/executors/java b/lxc/executors/java index 822e67d..9cbc6f7 100755 --- a/lxc/executors/java +++ b/lxc/executors/java @@ -1,6 +1,6 @@ cd /tmp/$2 cp code.code interim.java -name=$(cat interim.java | grep -Eo 'public\s+class\s+([A-Za-z0-9]+)' | sed -n 's/ */ /gp' | cut -d' ' -f3) +name=$(cat interim.java | grep -Eo '(public\s+class|interface)\s+([A-Za-z0-9]+)' | sed -n 's/ */ /gp' | cut -d' ' -f3) mv interim.java $name.java timeout -s KILL 10 javac $name.java runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 java $name" From b7615b8126fda4e499e1e97e8d89f0585a0034f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Barbi=C4=87?= Date: Fri, 30 Oct 2020 21:39:58 +0100 Subject: [PATCH 07/20] Fix name detection --- lxc/executors/java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/executors/java b/lxc/executors/java index 9cbc6f7..9b26c1a 100755 --- a/lxc/executors/java +++ b/lxc/executors/java @@ -1,6 +1,6 @@ cd /tmp/$2 cp code.code interim.java -name=$(cat interim.java | grep -Eo '(public\s+class|interface)\s+([A-Za-z0-9]+)' | sed -n 's/ */ /gp' | cut -d' ' -f3) +name=$(cat interim.java | sed -E 's/(public\s+class|interface)\s+([A-Za-z0-9]+)/\2/') mv interim.java $name.java timeout -s KILL 10 javac $name.java runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 java $name" From f133ce04e0670db2f0f686574c90aadb8a7e852f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Barbi=C4=87?= Date: Fri, 30 Oct 2020 22:15:01 +0100 Subject: [PATCH 08/20] Replace regex completely Now supports enums aswell --- lxc/executors/java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/executors/java b/lxc/executors/java index 9b26c1a..08e1fb5 100755 --- a/lxc/executors/java +++ b/lxc/executors/java @@ -1,6 +1,6 @@ cd /tmp/$2 cp code.code interim.java -name=$(cat interim.java | sed -E 's/(public\s+class|interface)\s+([A-Za-z0-9]+)/\2/') +name=$(grep -Po "(?<=\n|\A)\s*(public\s+)?(class|interface|enum)\s+\K([^\n\s{]+)" interim.java) mv interim.java $name.java timeout -s KILL 10 javac $name.java runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 java $name" From 65d66aa979f1d5ef48299abda71590fc408c0f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Barbi=C4=87?= Date: Fri, 30 Oct 2020 22:17:46 +0100 Subject: [PATCH 09/20] Get rid of enum --- lxc/executors/java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/executors/java b/lxc/executors/java index 08e1fb5..66261bb 100755 --- a/lxc/executors/java +++ b/lxc/executors/java @@ -1,6 +1,6 @@ cd /tmp/$2 cp code.code interim.java -name=$(grep -Po "(?<=\n|\A)\s*(public\s+)?(class|interface|enum)\s+\K([^\n\s{]+)" interim.java) +name=$(grep -Po "(?<=\n|\A)\s*(public\s+)?(class|interface)\s+\K([^\n\s{]+)" interim.java) mv interim.java $name.java timeout -s KILL 10 javac $name.java runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 java $name" From 5134eb961b21d7ea7ef011db91f5b898d2f8cc4a Mon Sep 17 00:00:00 2001 From: Vrganj Date: Sat, 31 Oct 2020 20:02:16 +0100 Subject: [PATCH 10/20] Add executor and test for Nim --- lxc/executors/nim | 4 ++++ lxc/tests/test.nim | 1 + lxc/versions | 3 +++ 3 files changed, 8 insertions(+) create mode 100755 lxc/executors/nim create mode 100644 lxc/tests/test.nim diff --git a/lxc/executors/nim b/lxc/executors/nim new file mode 100755 index 0000000..c6e6caf --- /dev/null +++ b/lxc/executors/nim @@ -0,0 +1,4 @@ +cd /tmp/$2 +timeout -s KILL 10 nim --hints:off c code.code +runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./code" + diff --git a/lxc/tests/test.nim b/lxc/tests/test.nim new file mode 100644 index 0000000..bd50e25 --- /dev/null +++ b/lxc/tests/test.nim @@ -0,0 +1 @@ +echo("good") diff --git a/lxc/versions b/lxc/versions index c53e779..31bcd39 100755 --- a/lxc/versions +++ b/lxc/versions @@ -69,6 +69,9 @@ echo 'nasm' lxc-attach --clear-env -n piston -- /bin/bash -l -c "nasm -version" echo '---' +echo 'nim' +lxc-attack --clear-env -n piston -- /bin/bash -l -c "nim -v | head -n1" + echo 'node' lxc-attach --clear-env -n piston -- /bin/bash -l -c "node --version" echo '---' From 812679d6287a15727b67d46e18497f702051ecef Mon Sep 17 00:00:00 2001 From: Vrganj Date: Sat, 31 Oct 2020 20:10:27 +0100 Subject: [PATCH 11/20] Add install to readme --- readme.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/readme.md b/readme.md index 2f6c119..5447cf8 100644 --- a/readme.md +++ b/readme.md @@ -240,6 +240,16 @@ echo 'export DENO_INSTALL="/opt/.deno"' >> /opt/.profile echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> /opt/.profile source /opt/.profile +# install nim +# final binary: /opt/nim/bin/nim +# get version: /opt/nim/bin/nim -v +cd /opt && mkdir nim && cd nim +wget https://nim-lang.org/download/nim-1.4.0-linux_x64.tar.xz +unxz nim-1.4.0-linux_x64.tar.xz +tar -xf nim-1.4.0-linux_x64.tar +cd nim-1.4.0 +./install.sh /opt + # create runnable users and apply limits for i in {1..150}; do useradd -M runner$i From 13a0c356805b19df8d5ba0c3633548c78014a6c5 Mon Sep 17 00:00:00 2001 From: Vrganj Date: Sat, 31 Oct 2020 20:13:17 +0100 Subject: [PATCH 12/20] Add Nim to API --- api/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/api/main.go b/api/main.go index 446f3e4..1273576 100644 --- a/api/main.go +++ b/api/main.go @@ -83,6 +83,7 @@ func Execute(res http.ResponseWriter, req *http.Request) { "lua", "nasm", "asm", "nasm64", "asm64", + "nim", "node", "javascript", "js", "perl", "pl", "php", From f4564047cc19f6e608ca41e806ba80b11e0433bb Mon Sep 17 00:00:00 2001 From: Vrganj Date: Sat, 31 Oct 2020 20:36:04 +0100 Subject: [PATCH 13/20] Add Nim to PATH --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 5447cf8..af6c793 100644 --- a/readme.md +++ b/readme.md @@ -249,6 +249,8 @@ unxz nim-1.4.0-linux_x64.tar.xz tar -xf nim-1.4.0-linux_x64.tar cd nim-1.4.0 ./install.sh /opt +echo 'export PATH=$PATH:/opt/nim/bin' >> /opt/.profile +source /opt/.profile # create runnable users and apply limits for i in {1..150}; do From 3ef1e2683ed9d801e91b6a1d0bea7fd3d9a79e5f Mon Sep 17 00:00:00 2001 From: Pyroseza Date: Mon, 2 Nov 2020 00:24:32 +0000 Subject: [PATCH 14/20] looks like I forgot to push this bad boy --- lxc/tests/test_paradoc.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 lxc/tests/test_paradoc.py diff --git a/lxc/tests/test_paradoc.py b/lxc/tests/test_paradoc.py new file mode 100644 index 0000000..3acba15 --- /dev/null +++ b/lxc/tests/test_paradoc.py @@ -0,0 +1,5 @@ +try: + import paradoc + print('good') +except: + pass From d218402a5f2307329167dd0446302a63da1c54e6 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Sun, 1 Nov 2020 19:25:16 -0600 Subject: [PATCH 15/20] fix typo, add test entry for nim --- lxc/test_all_lxc | 2 ++ lxc/versions | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lxc/test_all_lxc b/lxc/test_all_lxc index f2068bd..9882c54 100755 --- a/lxc/test_all_lxc +++ b/lxc/test_all_lxc @@ -31,6 +31,8 @@ echo 'testing asm 32 bit' ../execute asm test.nasm echo 'testing asm 64 bit' ../execute asm64 test64.nasm +echo 'testing nim' +../execute nim test.nim echo 'testing php' ../execute php test.php echo 'testing perl' diff --git a/lxc/versions b/lxc/versions index 31bcd39..b30e2e2 100755 --- a/lxc/versions +++ b/lxc/versions @@ -70,7 +70,8 @@ lxc-attach --clear-env -n piston -- /bin/bash -l -c "nasm -version" echo '---' echo 'nim' -lxc-attack --clear-env -n piston -- /bin/bash -l -c "nim -v | head -n1" +lxc-attach --clear-env -n piston -- /bin/bash -l -c "nim -v | head -n1" +echo '---' echo 'node' lxc-attach --clear-env -n piston -- /bin/bash -l -c "node --version" From 44097f9dc287f790728af5079ba63aecbbba41fb Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Sun, 1 Nov 2020 19:26:09 -0600 Subject: [PATCH 16/20] add nim to execute --- lxc/execute | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lxc/execute b/lxc/execute index 5e71f4a..23ffdae 100755 --- a/lxc/execute +++ b/lxc/execute @@ -90,6 +90,9 @@ case "$lang" in "nasm64" | "asm64") bin=nasm64 ;; +"nim") + bin=nim + ;; "node" | "js" | "javascript") bin=node ;; From f6e5615ac2ef387923c32cc9a30f7d06023dcf18 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Sun, 1 Nov 2020 19:30:05 -0600 Subject: [PATCH 17/20] add paradoc to execute --- lxc/execute | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lxc/execute b/lxc/execute index 23ffdae..45a7f46 100755 --- a/lxc/execute +++ b/lxc/execute @@ -99,6 +99,9 @@ case "$lang" in "deno" | "denojs" | "denots") bin=deno ;; +"paradoc") + bin=paradoc + ;; "perl") bin=perl ;; From 269547f75b56ea798ea781ff0da6e44834e08f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Barbi=C4=87?= Date: Sun, 8 Nov 2020 18:03:28 +0100 Subject: [PATCH 18/20] Fix paradoc --- lxc/executors/python3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/executors/python3 b/lxc/executors/python3 index 0749d88..935aa3d 100755 --- a/lxc/executors/python3 +++ b/lxc/executors/python3 @@ -1,2 +1,2 @@ cd /tmp/$2 -runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 python3.8 code.code" +runuser runner$1 -c "cd /tmp/$2 ; timeout -s KILL 3 python3.8 code.code <<< args.args" From 38638aa6f65dd154fdf306401a445e204d7ad85e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Barbi=C4=87?= Date: Sun, 8 Nov 2020 19:13:22 +0100 Subject: [PATCH 19/20] Fix screwup --- lxc/executors/python3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/executors/python3 b/lxc/executors/python3 index 935aa3d..0749d88 100755 --- a/lxc/executors/python3 +++ b/lxc/executors/python3 @@ -1,2 +1,2 @@ cd /tmp/$2 -runuser runner$1 -c "cd /tmp/$2 ; timeout -s KILL 3 python3.8 code.code <<< args.args" +runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 python3.8 code.code" From 93600d75fedf85cdebeda5a9fc8bac230909dc3e Mon Sep 17 00:00:00 2001 From: Vrganj Date: Sun, 8 Nov 2020 19:15:56 +0100 Subject: [PATCH 20/20] Actually fix paradoc --- lxc/executors/paradoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc/executors/paradoc b/lxc/executors/paradoc index 4a7e9c5..33fe880 100755 --- a/lxc/executors/paradoc +++ b/lxc/executors/paradoc @@ -1,2 +1,2 @@ cd /tmp/$2 -runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 python3 -m paradoc code.code" +runuser runner$1 -c "cd /tmp/$2 ; timeout -s KILL 3 python3 -m paradoc code.code <<< args.args"