From e1f1e6b3c56872636c636c3f2a00c125311b26bf Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Thu, 4 Jun 2020 20:01:21 -0500 Subject: [PATCH] finish adding kotlin and perl --- api/main.go | 2 ++ lxc/execute | 3 +++ lxc/executors/elixir | 0 lxc/executors/perl | 2 ++ lxc/test.exs | 1 + readme.md | 14 ++++++++++++-- tests/test.pl | 1 + tests/test_all_lxc | 6 ++++-- 8 files changed, 25 insertions(+), 4 deletions(-) mode change 100644 => 100755 lxc/executors/elixir create mode 100755 lxc/executors/perl create mode 100644 lxc/test.exs create mode 100644 tests/test.pl diff --git a/api/main.go b/api/main.go index 95a2806..17a4d4c 100644 --- a/api/main.go +++ b/api/main.go @@ -71,12 +71,14 @@ func Execute(res http.ResponseWriter, req *http.Request) { "cpp", "c++", "csharp", "cs", "c#", "elixir", "exs", + "emacs", "go", "java", "julia", "jl", "kotlin", "nasm", "asm", "node", "javascript", "js", + "perl", "pl", "php", "python2", "python3", "python", diff --git a/lxc/execute b/lxc/execute index 0997041..3c7880a 100755 --- a/lxc/execute +++ b/lxc/execute @@ -78,6 +78,9 @@ case "$lang" in "node" | "js" | "javascript") bin=node ;; +"perl") + bin=perl + ;; "php") bin=php ;; diff --git a/lxc/executors/elixir b/lxc/executors/elixir old mode 100644 new mode 100755 diff --git a/lxc/executors/perl b/lxc/executors/perl new file mode 100755 index 0000000..afb8ad5 --- /dev/null +++ b/lxc/executors/perl @@ -0,0 +1,2 @@ +cd /tmp/$2 +runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 perl code.code" diff --git a/lxc/test.exs b/lxc/test.exs new file mode 100644 index 0000000..4c8d8b0 --- /dev/null +++ b/lxc/test.exs @@ -0,0 +1 @@ +IO.puts("good") diff --git a/readme.md b/readme.md index 887a48e..9f524eb 100644 --- a/readme.md +++ b/readme.md @@ -46,7 +46,7 @@ apt-get update apt-get install -y \ nano wget build-essential pkg-config libxml2-dev \ libsqlite3-dev mono-complete curl cmake libpython2.7-dev \ - ruby + ruby libtinfo-dev # install python2 # final binary: /opt/python2/Python-2.7.17/python -V @@ -149,7 +149,7 @@ echo 'export PATH=$PATH:/opt/julia/julia-1.4.1/bin' >> /opt/.profile source /opt/.profile # install kotlin -# final binary: /opt/kotlinc/bin/kotlinc +# final binary: /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 @@ -174,6 +174,16 @@ mkdir elixir-1.10.3 && unzip Precompiled.zip -d elixir-1.10.3/ echo 'export PATH=$PATH:/opt/elixir/elixir-1.10.3/bin' >> /opt/.profile source /opt/.profile +# install emacs +# final binary: /opt/emacs/emacs-26.3/src/emacs --version +cd /opt && mkdir emacs && cd emacs +wget https://mirrors.ocf.berkeley.edu/gnu/emacs/emacs-26.3.tar.xz +tar -xf emacs-26.3.tar.xz +cd emacs-26.3 +./configure --with-gnutls=no +echo 'export PATH=$PATH:/opt/emacs/emacs-26.3/src' >> /opt/.profile +source /opt/.profile + # create runnable users and apply limits for i in {1..150}; do useradd -M runner$i diff --git a/tests/test.pl b/tests/test.pl new file mode 100644 index 0000000..89d8636 --- /dev/null +++ b/tests/test.pl @@ -0,0 +1 @@ +print "good\n"; diff --git a/tests/test_all_lxc b/tests/test_all_lxc index 51f8e72..ea8f3e4 100755 --- a/tests/test_all_lxc +++ b/tests/test_all_lxc @@ -8,8 +8,8 @@ echo 'testing cpp' ../lxc/execute cpp test.cpp echo 'testing cs' ../lxc/execute cs test.cs -echo 'testing elixir' -../lxc/exexute exs test.exs +#echo 'testing elixir' +#../lxc/execute exs test.exs echo 'testing go' ../lxc/execute go test.go echo 'testing java' @@ -24,6 +24,8 @@ echo 'testing jl' ../lxc/execute jl test.jl echo 'testing php' ../lxc/execute php test.php +echo 'testing perl' +../lxc/execute perl test.pl echo 'testing python2' ../lxc/execute python2 test2.py echo 'testing python3'